-
Notifications
You must be signed in to change notification settings - Fork 20
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
Update Formatting Tools #182
Conversation
Also add `PullRequest` to `ignore_words.txt`
Codecov Report
@@ Coverage Diff @@
## main #182 +/- ##
=======================================
Coverage 97.22% 97.22%
=======================================
Files 8 8
Lines 648 648
Branches 90 90
=======================================
Hits 630 630
Partials 18 18 |
Currently, this is only use for configuring linters and formatters (no build file specifications are set). Configuration options for `black` and `pydocstyle` are added here in this commit.
This supports conda test/build environments.
Make this match settings specififed in `Makefile`.
All checks are placed in appropriate config files. Test runner scripts point to these so that there exists a single source of truth for all configurations and that the tests performed across systems is the same. This may be adjusted, of course, if different settings must be used on a per-system basis.
This package supports reading `pyproject.toml`, which is required for some of our tests.
fd280e3
to
a914a24
Compare
`pre-commit` is known to override behavior from config files in certain instances. This commit fixes known issues for: - `isort` - `black` - `mypy` - `pydocstyle` For relevant details, see: isort: + https://jugmac00.github.io/blog/isort-and-pre-commit-a-friendship-with-obstacles/ + PyCQA/isort#885 black: + psf/black#1584 mypy/pydocstyle: + python/mypy#4008 (comment) + https://pre-commit.com/#hooks-pass_filenames
d040a4d
to
a07f259
Compare
@pyvista/developers This is ready for review. Can you please review? (I will perform style fixes in another PR after this is approved). |
@adeak @akaszynski @tkoyama010 Actually, the existing formatting errors will cause tests to fail. Please let me know if you would like me to (a) fix them here, or (b) ignore the offending files here and fix them in another PR. |
I vote ignore BTW: Good work implementing the pre-commit. Remove |
Thanks @akaszynski . I'm glad I took your and @adeak 's suggestion. Not only is this cleaner, but I actually learned a lot! |
Ignore linting errors in source code in this PR. The purpose of this PR is to update linting tools. A future PR will correct the errors. This is done to separate concerns.
7220551
to
7162d28
Compare
@akaszynski All checks have passed. |
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.
LGTM. Thanks, as a followup we'll need to work on mypy.
You got it. I've been practicing 😉 . I'll be sure to link this PR to the next one that cleans up the linting errors we just ignored. |
Sorry, I got here too late. Nice work @adam-grant-hendry! |
The purpose of this PR is a series of formatting changes to bring
pyvistaqt
formatting tools up to date:Configuration Changes
.flake8
and.codespellrc
configuration files, updatingignore_words.txt
too (bd8914a)pyproject.toml
(ec25ae7)black
andpydocstyle
configuration options topyproject.toml
(matching options inMakefile
and those inpyvista
repo and adding corresponding support in.isort.cfg
)pre-commit
(including.pre-commit-config.yaml
file) (e041a8b)mypy
,isort
,black
, andpydocstyle
withpre-commit
(a07f259)environment.yml
to includemypy
dependency (matchingpip
requirements) (ae09730).pylintrc
to match files ignored inMakefile
(c68e16d)Makefile
andpre-commit
, placing all options in config files and pointing to those. This ensures the same checks happen across different systems and all config changes happen in one place as a single source of truth. (31af1e5)toml
to requirements,environment.yml
, andci/azure-pipelines.yml
(supports reading configurations frompyproject.toml
) (a914a24)