Skip to content

configure pre-commit for project #346

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

Merged
merged 5 commits into from
Mar 3, 2022
Merged

Conversation

abn
Copy link
Collaborator

@abn abn commented Mar 1, 2022

This change moves black and doc8 checking into pre-commit hooks. This also simplifies the ci code quality workflow. In addition, doc8 configuration is now moved to pyproject.toml.

This is more a proposal to make development experience a bit easier and standardised. It helps to not have to remember to execute all the required checks before pushing up code. Additionally, having a standard config mechanism helps the CI job to be simpler. This can potentially be outsourced to pre-commit.ci as well to keep the hooks up-to-date.

peo: fix black task to include gitignore

When --exclude is used, the default exclude list is overwritten. The expected option is --extend-exclude. However, since the generated files are already ignored, these flags can be safely skipped,

@abn abn force-pushed the chore/linting branch from 091a703 to ec86ff8 Compare March 1, 2022 23:07
@abn
Copy link
Collaborator Author

abn commented Mar 1, 2022

Not really sure why the CI is failing on generation as none of that code has been touched here.

@abn
Copy link
Collaborator Author

abn commented Mar 2, 2022

The CI failures were caused as black was removed from development dependency and poetry does not activate extras by default.

@abn
Copy link
Collaborator Author

abn commented Mar 2, 2022

The new failures should be resolved via #345.

abn added 5 commits March 3, 2022 18:12
This change moves black and doc8 checking into pre-commit hooks. This
also simplifies the ci code quality workflow.

In addition, doc8 configuration is now moved to `pyproject.toml`.
When `--exclude` is used, the default exclude list is overwritten. The
expected option is `--extend-exclude`. However, since the generated
files are already ignored, these flags can be safely skipped,
@abn abn force-pushed the chore/linting branch from 60adc3b to dfb7b4b Compare March 3, 2022 17:13
@abn
Copy link
Collaborator Author

abn commented Mar 3, 2022

@Gobot1234 would be great to get this one in too; should speed up CI by ~2.5 minutes based on the current active runs. Particularly since the cache key is the lock file too.

@Gobot1234 Gobot1234 merged commit a836fb2 into danielgtaylor:master Mar 3, 2022
@abn abn deleted the chore/linting branch March 3, 2022 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants