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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pre-commit #222
Add pre-commit #222
Conversation
Thanks @JoshKarpel, I've enabled Ward on pre-commit.ci now. Should hopefully kick off for any future commits :) |
Codecov Report
@@ Coverage Diff @@
## master #222 +/- ##
==========================================
- Coverage 77.37% 77.36% -0.02%
==========================================
Files 21 21
Lines 1671 1670 -1
Branches 264 264
==========================================
- Hits 1293 1292 -1
Misses 339 339
Partials 39 39
Continue to review full report at Codecov.
|
It failed correctly! https://results.pre-commit.ci/run/github/164605649/1621640070.FquJsw8gSgSgOr7bZnhDCw |
- id: python-use-type-annotations | ||
- id: rst-directive-colons | ||
- id: rst-inline-touching-normal | ||
- repo: https://github.com/asottile/blacken-docs |
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.
Incidental benefit: this forces all code examples in the docs to at least be parseable :)
rev: 21.5b1 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/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.
This would introduce a new formatter on top of what is currently used; I like it because it enforces a consistent import style. It can be customized further, but I started with the basic "compatible with black
and the way people normally write imports" settings.
There's a lot of conflicts here but I suspect a |
@JoshKarpel #217 is now merged. I've fixed the conflicts here and pre-commit is passing in this PR now. |
Final cleanup done! |
Yay, thanks! 馃帀 |
* master: (133 commits) Prepare 0.63.0b0 Distribute type data (PEP 561) (darrenburns#283) Type check `ward.testing` (darrenburns#282) [pre-commit.ci] pre-commit autoupdate (darrenburns#280) Add pretty output for all comparison failures (darrenburns#256) Update conf.py Update pyproject.toml Make sure raises raises assertion error when no exception is raised (darrenburns#281) [pre-commit.ci] pre-commit autoupdate (darrenburns#275) Fix mypy error Prepare 0.62.0b0 Update writing_tests.rst Allow subclasses of specified exception class to pass raises assertion (darrenburns#279) Type check `ward.expect`, `ward._fixtures` and `ward._terminal` (darrenburns#274) Only require `poetry-core` as build system (darrenburns#277) Prepare 0.61.1b0 Allow Click 7 (darrenburns#272) Type check `ward._config` (darrenburns#269) Correct plural, singular forms darrenburns#244 (darrenburns#258) Prepare 0.61.0b0 Switch from `toml` to `tomli` for TOML v1 compat (darrenburns#267) Introduce mypy (gradually) (darrenburns#265) Don't update the lockfile with 'make prep' (darrenburns#266) Let Poetry automatically update license and py version classifiers (darrenburns#260) Prepare 0.60.1b0 Fix broken command (darrenburns#257) fix typo (darrenburns#255) Prepare 0.60.0b0 Update live output gif for docs Add info on `live` output mode to docs Print pretty failure messages for `in` and `not in` (darrenburns#242) Add `live` progress style and refactor output and progress styles (darrenburns#233) only get test source once (darrenburns#249) [pre-commit.ci] pre-commit autoupdate (darrenburns#248) pygments dependency removed - no longer required Update build.yml Update README.md Prepare 0.59.0b0 Use Rich for displaying diffs in errors (darrenburns#235) Prepare 0.58.0b0 Several bug fixes (darrenburns#241) combine build and pullrequest workflows (darrenburns#236) Add Python 3.10 Beta support to CI (darrenburns#230) Update CONTRIBUTING.md Prepare 0.57.2b0 Remove comment from build pipeline Bump snok/install-poetry from 1.1.1 to 1.1.6 (darrenburns#232) add dependabot.yml for gha version bumps (darrenburns#231) Add pre-commit (darrenburns#222) fix linter errors (darrenburns#217) ...
Threw this together re: https://github.com/darrenburns/ward/discussions/214#discussioncomment-767992 , since I guess I have
Opinions
about which hooks to use 馃槢Depends on #217 to actually pass...
@darrenburns if you want to use pre-commit.ci , can you opt-in at https://pre-commit.ci/ ? It should work, since this branch has a
.pre-commit-config.yaml
. If you don't want to use the external service, we can set up the checks as a GitHub Actions workflow.WIP...