Skip to content

Commit

Permalink
Pre commit autoformat (#846)
Browse files Browse the repository at this point in the history
* 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`.
  • Loading branch information
lmarini authored Feb 12, 2024
1 parent 5b0c903 commit ba6835f
Show file tree
Hide file tree
Showing 261 changed files with 20,740 additions and 8,870 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 180
extend-ignore = E203, E266, E501, W503, E741, E711
exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,venv/*,src/*,.rst,build
max-complexity=16
2 changes: 1 addition & 1 deletion .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.messagesMeta.outputs.tags }}
file: ./backend/messages.Dockerfile
labels: ${{ steps.messagesMeta.outputs.labels }}
labels: ${{ steps.messagesMeta.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Run Codegen
working-directory: frontend
run: npm run codegen:v2:test

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v14
id: verify-changed-files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Publish to NCSA OpenSource
if: |
github.event_name != 'pull_request'
github.event_name != 'pull_request'
&& github.repository == env.MAIN_REPO
uses: bsord/[email protected]
with:
Expand Down
53 changes: 53 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
repos:
- repo: local
hooks:
- id: extract-openapi
name: extract-openapi
entry: pipenv run extract-openapi
language: system
pass_filenames: false
- repo: local
hooks:
- id: generate-frontend-api-client
name: generate-frontend-api-client
entry: bash -c 'cd frontend && npm run codegen:v2:file'
language: system
pass_filenames: false
- repo: local
hooks:
- id: eslint
name: eslint
entry: bash -c "cd frontend && npx eslint --fix src"
language: system
- repo: local
hooks:
- id: prettier
name: prettier
entry: bash -c "cd frontend && npx prettier src --write"
language: system
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [ "--profile=black" ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
exclude: deployments/kubernetes/charts
- id: end-of-file-fixer
exclude: 'openapi.json|frontend/src/openapi/v2/'
- id: trailing-whitespace
exclude: 'openapi.json|frontend/src/openapi/v2/'
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion .run/Clowder2 Dev.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
<toRun name="uvicorn" type="PythonConfigurationType" />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/Debug.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<configuration default="false" name="Debug" type="JavascriptDebugType" uri="http://localhost:3000">
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/Docker Dev.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
</deployment>
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/Python tests in tests.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/start.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<envs />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/start_dev.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<envs />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/uvicorn.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>
</component>
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ sphinx-material = "*"

[requires]
python_version = "3.9"

[scripts]
extract-openapi = "python backend/extract-openapi.py app.main:app"
231 changes: 101 additions & 130 deletions Pipfile.lock

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![](docs/source/img/logo_full.png)
![](docs/source/img/logo_full.png)

# Clowder v2 (In active development)
[![Build Status](https://github.com/clowder-framework/clowder2/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/clowder-framework/clowder2/actions?query=branch%3Amain)
Expand All @@ -9,8 +9,8 @@
*For the previous version of Clowder, please see [Clowder v1](https://github.com/clowder-framework/clowder).*

Clowder v2 is a reimagining of the [Clowder research data management system](https://clowderframework.org/)
using a different and newer technology stack. Clowder is a cloud native data management framework to support any
research domain. Clowder was developed to help researchers and scientists in data intensive domains manage raw data,
using a different and newer technology stack. Clowder is a cloud native data management framework to support any
research domain. Clowder was developed to help researchers and scientists in data intensive domains manage raw data,
complex metadata, and automatic data pipelines.

While the Clowder v1 has worked well over the years, many of the underlying
Expand All @@ -31,36 +31,36 @@ The v2 documentation is still work in progress. It's available at https://clowde

The v1 documentation is not fully compatible with v2, but it does provide some still relevant information.
It is available at https://clowder-framework.readthedocs.io.
There is a few other documentation links available on the [website](https://clowderframework.org/documentation.html).
There is a few other documentation links available on the [website](https://clowderframework.org/documentation.html).

## Installation

The easiest way of running Clowder v2 is checking out the [code](https://github.com/clowder-framework/clowder2)
The easiest way of running Clowder v2 is checking out the [code](https://github.com/clowder-framework/clowder2)
and running `docker compose up` in the main directory.

Helm charts are available for running Clowder v2 on Kubernetes. See the [helm](https://github.com/clowder-framework/clowder2/tree/main/deployments/kubernetes/charts) directory for more information.

## Contributing

We are always looking for contributors. This could be anything from fixing bugs, adding new features, providing new
feature requests, reccomending UI/UX improvements, helping with the documentation, or just testing the system and
We are always looking for contributors. This could be anything from fixing bugs, adding new features, providing new
feature requests, reccomending UI/UX improvements, helping with the documentation, or just testing the system and
providing feedback. Here are a few ways to get started:

- Join our [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA)
- Join our [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA)
channel, introduce yourself, and ask questions about the specific aspects of the system you are interested in.
- Submit an issue (bug or feature request) on the [issue tracker](https://github.com/clowder-framework/clowder2/issues).
- Submit a [pull request](https://github.com/clowder-framework/clowder2/pulls) with a bug fix or new feature. For
- Submit a [pull request](https://github.com/clowder-framework/clowder2/pulls) with a bug fix or new feature. For
larger changes, it's best to open an issue first or ask on Slack to discuss the changes.
- Develop new [information extractors](https://github.com/clowder-framework/pyclowder) and/or visualizations.

Please follow our [code of conduct](https://github.com/clowder-framework/clowder/blob/develop/CODE_OF_CONDUCT.md) when
Please follow our [code of conduct](https://github.com/clowder-framework/clowder/blob/develop/CODE_OF_CONDUCT.md) when
interacting with the community.

## Support & Contacts

The easiest way to get in touch with us is [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA).
This is a public forum. If you prefer email, you can contact us at [[email protected]](mailto:[email protected]).
This is a public forum. If you prefer email, you can contact us at [[email protected]](mailto:[email protected]).

## License

Clowder v2 is licensed under the [Apache 2.0 license](https://github.com/clowder-framework/clowder2/blob/main/LICENSE).
Clowder v2 is licensed under the [Apache 2.0 license](https://github.com/clowder-framework/clowder2/blob/main/LICENSE).
6 changes: 6 additions & 0 deletions backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ rocrate = "0.7.0"
httpx = "0.24.0"
packaging = "23.1"
itsdangerous = "2.1.2"
flake8 = "*"
pyflakes = "*"
autoflake = "*"
isort = "*"
shellcheck-py = "*"
pre-commit = "*"

[dev-packages]
requests = "2.28.2"
Expand Down
Loading

0 comments on commit ba6835f

Please sign in to comment.