Skip to content

Commit ba6835f

Browse files
authored
Pre commit autoformat (#846)
* Removed unused imports using autoflake. * Ordered imports using isort. * Reformatted using black. * Setting up pre-commits. * Ran pre-commit an all files. * Working on creating openapi.json without running backend to be used with codegen. * Fixed `MUI: The Tabs component doesn't accept a Fragment as a child.` * Fixed runtime error due to replacing `== None` with 'is None'. * Fixed runtime error due to replacing `== None` with 'is None'. * Automatically generate openapi json file using pre-commit hook. * Added codegen precommit hook. * Setting up prettier and eslint. * First run of prettier. * Runnin eslint and prettier as hooks. * Skip codegen directories when running eslint and prettier. * Flake8 E711 exception. Required for Beanie query to work. * Fixed search_users_prefix codegen stub. * Fixed beanie query for get_dataset_folders. * Ignore Flake8 E711 since beanie query do not support `is None`.
1 parent 5b0c903 commit ba6835f

File tree

261 files changed

+20740
-8870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+20740
-8870
lines changed

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 180
3+
extend-ignore = E203, E266, E501, W503, E741, E711
4+
exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,venv/*,src/*,.rst,build
5+
max-complexity=16

.github/workflows/backend.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ jobs:
111111
push: ${{ github.event_name != 'pull_request' }}
112112
tags: ${{ steps.messagesMeta.outputs.tags }}
113113
file: ./backend/messages.Dockerfile
114-
labels: ${{ steps.messagesMeta.outputs.labels }}
114+
labels: ${{ steps.messagesMeta.outputs.labels }}

.github/workflows/codegen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Run Codegen
5858
working-directory: frontend
5959
run: npm run codegen:v2:test
60-
60+
6161
- name: Verify Changed files
6262
uses: tj-actions/verify-changed-files@v14
6363
id: verify-changed-files

.github/workflows/helm-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
- name: Publish to NCSA OpenSource
5252
if: |
53-
github.event_name != 'pull_request'
53+
github.event_name != 'pull_request'
5454
&& github.repository == env.MAIN_REPO
5555
uses: bsord/[email protected]
5656
with:

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: extract-openapi
5+
name: extract-openapi
6+
entry: pipenv run extract-openapi
7+
language: system
8+
pass_filenames: false
9+
- repo: local
10+
hooks:
11+
- id: generate-frontend-api-client
12+
name: generate-frontend-api-client
13+
entry: bash -c 'cd frontend && npm run codegen:v2:file'
14+
language: system
15+
pass_filenames: false
16+
- repo: local
17+
hooks:
18+
- id: eslint
19+
name: eslint
20+
entry: bash -c "cd frontend && npx eslint --fix src"
21+
language: system
22+
- repo: local
23+
hooks:
24+
- id: prettier
25+
name: prettier
26+
entry: bash -c "cd frontend && npx prettier src --write"
27+
language: system
28+
- repo: https://github.com/psf/black
29+
rev: 23.11.0
30+
hooks:
31+
- id: black
32+
- repo: https://github.com/PyCQA/isort
33+
rev: 5.12.0
34+
hooks:
35+
- id: isort
36+
args: [ "--profile=black" ]
37+
- repo: https://github.com/pre-commit/pre-commit-hooks
38+
rev: v4.5.0
39+
hooks:
40+
- id: check-yaml
41+
exclude: deployments/kubernetes/charts
42+
- id: end-of-file-fixer
43+
exclude: 'openapi.json|frontend/src/openapi/v2/'
44+
- id: trailing-whitespace
45+
exclude: 'openapi.json|frontend/src/openapi/v2/'
46+
- repo: https://github.com/shellcheck-py/shellcheck-py
47+
rev: v0.9.0.6
48+
hooks:
49+
- id: shellcheck
50+
- repo: https://github.com/PyCQA/flake8
51+
rev: 6.1.0
52+
hooks:
53+
- id: flake8

.run/Clowder2 Dev.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<toRun name="uvicorn" type="PythonConfigurationType" />
66
<method v="2" />
77
</configuration>
8-
</component>
8+
</component>

.run/Debug.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<configuration default="false" name="Debug" type="JavascriptDebugType" uri="http://localhost:3000">
33
<method v="2" />
44
</configuration>
5-
</component>
5+
</component>

.run/Docker Dev.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
</deployment>
1111
<method v="2" />
1212
</configuration>
13-
</component>
13+
</component>

.run/Python tests in tests.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
<option name="_new_targetType" value="&quot;PATH&quot;" />
1515
<method v="2" />
1616
</configuration>
17-
</component>
17+
</component>

.run/start.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
<envs />
1010
<method v="2" />
1111
</configuration>
12-
</component>
12+
</component>

0 commit comments

Comments
 (0)