Skip to content

Commit

Permalink
Fix precommit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lichtefeld committed Dec 21, 2021
1 parent 84d454f commit 9d43554
Show file tree
Hide file tree
Showing 23 changed files with 306 additions and 189 deletions.
36 changes: 21 additions & 15 deletions adam/flask_backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,41 @@ def get_all_learners() -> Any:
"""Get all learner configurations which are prepared."""

return {
"learner_types": [
possible_dir.name
for possible_dir in LEARNERS_DIR.iterdir()
if possible_dir.is_dir()
]
"learner_types": sorted(
[
possible_dir.name
for possible_dir in LEARNERS_DIR.iterdir()
if possible_dir.is_dir()
]
)
}


@app.route("/api/training_curriculum", methods=["GET"])
def get_all_train_curriculum() -> Any:
"""Get all possible training curriculum."""
return {
"training_curriculum": [
possible_dir.name
for possible_dir in TRAINING_CURRICULUM_DIR.iterdir()
if possible_dir.is_dir()
]
"training_curriculum": sorted(
[
possible_dir.name
for possible_dir in TRAINING_CURRICULUM_DIR.iterdir()
if possible_dir.is_dir()
]
),
}


@app.route("/api/testing_curriculum", methods=["GET"])
def get_all_test_curriculum() -> Any:
"""Get all available test curriculum."""
return {
"testing_curriculum": [
possible_dir.name
for possible_dir in TESTING_CURRICULUM_DIR.iterdir()
if possible_dir.is_dir()
]
"testing_curriculum": sorted(
[
possible_dir.name
for possible_dir in TESTING_CURRICULUM_DIR.iterdir()
if possible_dir.is_dir()
]
)
}


Expand Down
1 change: 1 addition & 0 deletions adam/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
PRE_LEARN_FILE_NAME = "pre_decode.yaml"
POST_LEARN_FILE_NAME = "post_decode.yaml"
GENERATION_YAML_DIR_NAME = "generation_yaml"
CURRICULUM_INFO = "info.yaml"
145 changes: 145 additions & 0 deletions angular-viewer/adam-angular-demo/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/recommended--extra",
"prettier"
],
"plugins": ["deprecation", "import", "jsdoc"],
"rules": {
"@angular-eslint/component-selector": [
"error",
{ "type": "element", "prefix": "app", "style": "kebab-case" }
],
"@angular-eslint/directive-selector": [
"error",
{ "type": "attribute", "prefix": "app", "style": "camelCase" }
],
"@angular-eslint/no-empty-lifecycle-method": "off",
"@angular-eslint/use-component-view-encapsulation": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{ "accessibility": "explicit" }
],
"@typescript-eslint/member-ordering": [
"error",
{
"default": {
"memberTypes": ["signature", "field", "constructor", "method"]
}
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "snake_case", "UPPER_CASE"]
}
],
"@typescript-eslint/no-empty-function": [
"error",
{ "allow": ["constructors"] }
],
"@typescript-eslint/no-inferrable-types": [
"error",
{ "ignoreParameters": true }
],
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/quotes": [
"error",
"single",
{ "avoidEscape": true }
],
"capitalized-comments": [
"error",
"always",
{ "ignorePattern": "import", "ignoreConsecutiveComments": true }
],
"consistent-return": "error",
"curly": ["error", "all"],
"default-case": "error",
"default-case-last": "error",
"deprecation/deprecation": "warn",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"import/no-extraneous-dependencies": "error",
"import/no-internal-modules": "off",
"import/order": [
"error",
{ "alphabetize": { "order": "asc", "caseInsensitive": true } }
],
"jsdoc/no-types": "error",
"new-parens": "off",
"no-alert": "error",
"no-bitwise": "error",
"no-console": ["error", { "allow": ["error", "warn"] }],
"no-duplicate-case": "error",
"no-duplicate-imports": "error",
"no-else-return": "error",
"no-empty-function": "off",
"no-eval": "error",
"no-extra-bind": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-label-var": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-new-func": "error",
"no-param-reassign": "error",
"no-redeclare": "error",
"no-restricted-imports": ["error", "rxjs/Rx"],
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "error",
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-unreachable-loop": "error",
"no-unused-expressions": "error",
"no-unneeded-ternary": "error",
"no-use-before-define": "error",
"no-useless-backreference": "error",
"no-useless-concat": "error",
"no-useless-return": "error",
"no-var": "error",
"no-void": "error",
"prefer-object-spread": "error",
"quote-props": ["error", "as-needed"],
"sort-imports": [
"error",
{ "ignoreCase": true, "ignoreDeclarationSort": true }
],
"spaced-comment": ["error", "always", { "exceptions": ["*"] }],
"strict": "error"
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
}
]
}
16 changes: 16 additions & 0 deletions angular-viewer/adam-angular-demo/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-idiomatic-order"],
"plugins": ["stylelint-order"],
"rules": {
"color-function-notation": "legacy",
"order/order": [
"dollar-variables",
"custom-properties",
"at-rules",
"declarations",
{ "type": "at-rule", "name": "supports" },
{ "type": "at-rule", "name": "media" },
"rules"
]
}
}
13 changes: 7 additions & 6 deletions angular-viewer/adam-angular-demo/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { TestBed, async } from '@angular/core/testing';
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';

describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent],
}).compileComponents();
}));
});

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

it(`should have as title 'adam-angular-demo'`, () => {
it("should have as title 'adam-angular-demo'", () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('adam-angular-demo');
Expand Down
2 changes: 1 addition & 1 deletion angular-viewer/adam-angular-demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
Expand Down
21 changes: 15 additions & 6 deletions angular-viewer/adam-angular-demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { HeaderComponent } from './components/header/header.component';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { SelectorParentComponent } from './components/selector-parent/selector-parent.component';
import { ToastrModule } from 'ngx-toastr';
import { AppComponent } from './app.component';
import { ButtonComponent } from './components/button/button.component';
import { HeaderComponent } from './components/header/header.component';
import { ImageOutputComponent } from './components/image-output/image-output.component';
import { ObjectResultsComponent } from './components/object-results/object-results.component';
import { HttpClientModule } from '@angular/common/http';
import { PanelViewerComponent } from './components/panel-viewer/panel-viewer.component';
import { SelectorParentComponent } from './components/selector-parent/selector-parent.component';

@NgModule({
declarations: [
Expand All @@ -21,7 +23,14 @@ import { PanelViewerComponent } from './components/panel-viewer/panel-viewer.com
ObjectResultsComponent,
PanelViewerComponent,
],
imports: [FormsModule, BrowserModule, NgbModule, HttpClientModule],
imports: [
FormsModule,
BrowserModule,
NgbModule,
HttpClientModule,
ToastrModule.forRoot(),
BrowserAnimationsModule,
],
providers: [],
bootstrap: [AppComponent],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { subscribeOn } from 'rxjs/operators';
import { Features } from './features';
import { SubObject } from './sub-object';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ButtonComponent } from './button.component';

describe('ButtonComponent', () => {
let component: ButtonComponent;
let fixture: ComponentFixture<ButtonComponent>;

beforeEach(async(() => {
beforeEach(async () => {
TestBed.configureTestingModule({
declarations: [ButtonComponent],
}).compileComponents();
}));
});

beforeEach(() => {
fixture = TestBed.createComponent(ButtonComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { Component, EventEmitter, Output } from '@angular/core';

@Component({
selector: 'app-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.css'],
})
export class ButtonComponent implements OnInit {
export class ButtonComponent {
@Output() btnClick = new EventEmitter();

constructor() {}

ngOnInit(): void {}

OnClick() {
OnClick(): void {
this.btnClick.emit();
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { HeaderComponent } from './header.component';

describe('HeaderComponent', () => {
let component: HeaderComponent;
let fixture: ComponentFixture<HeaderComponent>;

beforeEach(async(() => {
beforeEach(async () => {
TestBed.configureTestingModule({
declarations: [HeaderComponent],
}).compileComponents();
}));
});

beforeEach(() => {
fixture = TestBed.createComponent(HeaderComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { NgbButtonsModule, NgbButtonLabel } from '@ng-bootstrap/ng-bootstrap';
import { Component } from '@angular/core';

@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css'],
})
export class HeaderComponent implements OnInit {
export class HeaderComponent {
constructor() {}

ngOnInit(): void {}
}
Loading

0 comments on commit 9d43554

Please sign in to comment.