diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21bf048d6..682d445f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: fix-byte-order-marker - id: trailing-whitespace - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.9.1 + rev: 23.12.1 hooks: - id: black files: "^backend/" @@ -40,13 +40,13 @@ repos: types: [python] exclude: "^backend/" - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort entry: bash -c "cd backend && isort ." types: [python] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.8.0 hooks: - id: mypy types_or: [python, spec] @@ -70,7 +70,7 @@ repos: files: "^backend/capellacollab" exclude: "^backend/capellacollab/alembic/" - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 + rev: v4.0.0-alpha.8 hooks: - id: prettier types_or: [ts, css, html, markdown] @@ -130,11 +130,11 @@ repos: - --comment-style - "..| |" - repo: https://github.com/fsfe/reuse-tool - rev: v2.1.0 + rev: v3.0.1 hooks: - id: reuse - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.51.0 + rev: v9.0.0-alpha.1 hooks: - id: eslint additional_dependencies: @@ -154,7 +154,7 @@ repos: exclude: '.+\.spec(-helper)?\.ts$' types_or: ["html", "ts"] - repo: https://github.com/qoomon/git-conventional-commits - rev: v2.6.5 + rev: v2.6.7 hooks: - id: conventional-commits - repo: https://github.com/asottile/pyupgrade diff --git a/frontend/src/app/projects/models/backup-settings/pipeline-runs/service/pipeline-run.service.ts b/frontend/src/app/projects/models/backup-settings/pipeline-runs/service/pipeline-run.service.ts index 5dc2db193..ba8b18e8e 100644 --- a/frontend/src/app/projects/models/backup-settings/pipeline-runs/service/pipeline-run.service.ts +++ b/frontend/src/app/projects/models/backup-settings/pipeline-runs/service/pipeline-run.service.ts @@ -125,13 +125,9 @@ export class PipelineRunService { this.setPipelineRunPageStatusToLoading(page); this.http - .get>( - `${this.urlFactory( - projectSlug, - modelSlug, - pipelineID, - )}?page=${page}&size=${size}`, - ) + .get< + Page + >(`${this.urlFactory(projectSlug, modelSlug, pipelineID)}?page=${page}&size=${size}`) .subscribe((pipelineRuns) => { const pipelineRunPages = this._pipelineRunPages.getValue(); pipelineRunPages.pages[page - 1] = pipelineRuns; diff --git a/frontend/src/app/projects/project-detail/model-overview/model-detail/git-model.service.ts b/frontend/src/app/projects/project-detail/model-overview/model-detail/git-model.service.ts index 04c760add..806156293 100644 --- a/frontend/src/app/projects/project-detail/model-overview/model-detail/git-model.service.ts +++ b/frontend/src/app/projects/project-detail/model-overview/model-detail/git-model.service.ts @@ -26,10 +26,9 @@ export class GitModelService { loadGitModels(project_slug: string, model_slug: string): void { this.http - .get>( - this.BACKEND_URL_PREFIX + - `/projects/${project_slug}/models/${model_slug}/modelsources/git`, - ) + .get< + Array + >(this.BACKEND_URL_PREFIX + `/projects/${project_slug}/models/${model_slug}/modelsources/git`) .subscribe((gitModels) => this._gitModels.next(gitModels)); } diff --git a/frontend/src/app/projects/project-detail/model-overview/move-model/move-model.component.ts b/frontend/src/app/projects/project-detail/model-overview/move-model/move-model.component.ts index 3fdb334a9..20c08eaee 100644 --- a/frontend/src/app/projects/project-detail/model-overview/move-model/move-model.component.ts +++ b/frontend/src/app/projects/project-detail/model-overview/move-model/move-model.component.ts @@ -41,9 +41,8 @@ export class MoveModelComponent { ) { this.projectService.loadProjectsForRole('manager'); this.filteredProjects$ = projectService.projects$.pipe( - map( - (projects) => - projects?.filter((project) => project.slug !== data.projectSlug), + map((projects) => + projects?.filter((project) => project.slug !== data.projectSlug), ), ); } @@ -85,11 +84,10 @@ export class MoveModelComponent { return this.filteredProjects$; } return this.filteredProjects$.pipe( - map( - (projects) => - projects?.filter((project) => - project.slug.toLowerCase().includes(this.search.toLowerCase()), - ), + map((projects) => + projects?.filter((project) => + project.slug.toLowerCase().includes(this.search.toLowerCase()), + ), ), ); } diff --git a/frontend/src/app/projects/project-detail/project-users/project-audit-log/service/project-audit-log.service.ts b/frontend/src/app/projects/project-detail/project-users/project-audit-log/service/project-audit-log.service.ts index 1542d9a60..264b3e5f0 100644 --- a/frontend/src/app/projects/project-detail/project-users/project-audit-log/service/project-audit-log.service.ts +++ b/frontend/src/app/projects/project-detail/project-users/project-audit-log/service/project-audit-log.service.ts @@ -70,9 +70,9 @@ export class ProjectAuditLogService { this.setProjectEventPageStatusToLoading(page); this.http - .get>( - `${environment.backend_url}/projects/${projectSlug}/events?page=${page}&size=${size}`, - ) + .get< + Page + >(`${environment.backend_url}/projects/${projectSlug}/events?page=${page}&size=${size}`) .subscribe((projectEvents) => { const projectHistoryEventPages = this._projectHistoryEventPages.getValue(); diff --git a/frontend/src/app/projects/project-detail/project-users/service/project-user.service.ts b/frontend/src/app/projects/project-detail/project-users/service/project-user.service.ts index 4f3c325a1..4da105f8f 100644 --- a/frontend/src/app/projects/project-detail/project-users/service/project-user.service.ts +++ b/frontend/src/app/projects/project-detail/project-users/service/project-user.service.ts @@ -50,11 +50,10 @@ export class ProjectUserService { public readonly nonAdminProjectUsers$ = this._projectUsers .asObservable() .pipe( - map( - (projectUsers) => - projectUsers?.filter( - (projectUser) => projectUser.role !== 'administrator', - ), + map((projectUsers) => + projectUsers?.filter( + (projectUser) => projectUser.role !== 'administrator', + ), ), ); diff --git a/frontend/src/app/services/settings/t4c-instance.service.ts b/frontend/src/app/services/settings/t4c-instance.service.ts index 783264234..bcccffdc7 100644 --- a/frontend/src/app/services/settings/t4c-instance.service.ts +++ b/frontend/src/app/services/settings/t4c-instance.service.ts @@ -67,9 +67,8 @@ export class T4CInstanceService { public readonly t4cInstance$ = this._t4cInstance.asObservable(); public readonly unarchivedT4cInstances$ = this._t4cInstances.pipe( - map( - (t4cInstances) => - t4cInstances?.filter((t4cInstance) => !t4cInstance.is_archived), + map((t4cInstances) => + t4cInstances?.filter((t4cInstance) => !t4cInstance.is_archived), ), ); diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.ts b/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.ts index 254fb7ec8..40074b0ef 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.ts +++ b/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.ts @@ -103,8 +103,8 @@ export class CreateReadonlySessionComponent implements OnInit { this.toolService.getVersionsForTool(tool.id).subscribe((toolVersions) => { const toolVersionIds = this.models?.map((m) => m.version?.id); - this.toolVersions = toolVersions.filter( - (v) => toolVersionIds?.includes(v.id), + this.toolVersions = toolVersions.filter((v) => + toolVersionIds?.includes(v.id), ); }); } diff --git a/frontend/src/app/settings/modelsources/t4c-settings/service/t4c-repos/t4c-repo.service.ts b/frontend/src/app/settings/modelsources/t4c-settings/service/t4c-repos/t4c-repo.service.ts index 863039464..1b8551c5e 100644 --- a/frontend/src/app/settings/modelsources/t4c-settings/service/t4c-repos/t4c-repo.service.ts +++ b/frontend/src/app/settings/modelsources/t4c-settings/service/t4c-repos/t4c-repo.service.ts @@ -39,9 +39,9 @@ export class T4CRepoService { loadRepositories(instanceId: number): void { this.http - .get( - `${this.t4cInstanceService.urlFactory(instanceId)}/repositories/`, - ) + .get< + T4CServerRepository[] + >(`${this.t4cInstanceService.urlFactory(instanceId)}/repositories/`) .subscribe({ next: (repositories) => this._repositories.next(repositories), error: () => this._repositories.next(undefined),