-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github action setup initiative #788
Conversation
I guess having this @tomvothecoder @acordonez could you please see if this looks okay to you? |
Pre-commit test is failing because it expects json files to follow python style... Not sure how to tell pre-commit check to ignore |
@lee1043 I found some info about flake8 in pre-commit hooks here: https://flake8.pycqa.org/en/latest/user/using-hooks.html. Might be able to add something like "exclude: *.json"? |
.pre-commit-config.yaml
Outdated
- repo: https://github.com/psf/black | ||
rev: 21.9b0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/timothycrosley/isort | ||
rev: 5.9.3 | ||
hooks: | ||
- id: isort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
black
is a code formatter and isort
is an import statement sorter.
I'm assuming the codebase did not integrate these QA tools previously. This means both of these tools (along with the other hooks) need to be run on the codebase and perform formatting as needed. Otherwise, pre-commit
will most likely throw error(s).
There are a few options moving forward
- Run
pre-commit
locally and format everything in this PR- This will produce a large diff regardless, so this might be the way to go
- Local usage:
pre-commit install
andpre-commit run --all-files
- Exclude these for now and open up another issue if you want to use these QA tools
- Exclude them and don't use them (I personally prefer to use them)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomvothecoder many thanks for the info. I think your guess is correct, that such tests have not been performed for the PMP codes. I think option 2 might be the most efficient way to move forward.
- repo: https://github.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
args: ["--config=setup.cfg"] | ||
additional_dependencies: [flake8-isort] | ||
exclude: ^sample_setups/jsons/ | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.910 | ||
hooks: | ||
- id: mypy | ||
args: ["--config=setup.cfg"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment regarding running the tools and fixing issues.
mypy
is an optional static type checker. flake8
and mypy
may catch some existing issues that need to be fixed manually.
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are general QA hooks
Configuring the QA tools/hooks:
|
Copied from xcdat repo