This repository has been archived by the owner on Oct 18, 2022. It is now read-only.
feat: refactor ci steps and add pre-commit validations #124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is being added
This PR refactors the CI steps executed by CircleCI and adds a new series of pre-commit and pre-push validations by using git hooks, husky, and pre-commit (python package).
The following packages are being used:
The CI steps are changed in the following ways:
How is everything configured
pyproject.toml
The last two years a new settings format, pyproject.toml has been gaining traction.
Now we can configure a lot of python-only tools (like poetry) in this file. For example, all the isort configuration is in this file under [tools.isort], which allows the dev to simply use isort isntead of a really long line of flags and configs. If we where to configure black, we would use this file too.
Pytest added support for this format on its 6.0.0 version, since we are already on that version I moved the configuration to this file.
The only problem with this setup is that flake8 doesn't support this config file.
TO-DO
Flake8 is a good linter as is, but we would have to add another file to configure it. If we where to use another linter, for example, pylint, that supports pyproject.toml, we could have all our python-only config in just one file.