Skip to content
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

Merged
merged 12 commits into from May 25, 2021
Merged

Add pre-commit #222

merged 12 commits into from May 25, 2021

Conversation

JoshKarpel
Copy link
Contributor

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...

@darrenburns
Copy link
Owner

Thanks @JoshKarpel, I've enabled Ward on pre-commit.ci now. Should hopefully kick off for any future commits :)

@codecov-commenter
Copy link

codecov-commenter commented May 21, 2021

Codecov Report

Merging #222 (371590a) into master (936d00e) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage 螖
ward/_rewrite.py 98.63% <酶> (酶)
ward/_collect.py 79.16% <100.00%> (酶)
ward/_config.py 89.65% <100.00%> (酶)
ward/_diff.py 12.79% <100.00%> (酶)
ward/_fixtures.py 100.00% <100.00%> (酶)
ward/_run.py 86.60% <100.00%> (酶)
ward/_suite.py 100.00% <100.00%> (酶)
ward/_terminal.py 52.28% <100.00%> (-0.11%) 猬囷笍
ward/_testing.py 96.66% <100.00%> (酶)
ward/_utilities.py 83.33% <100.00%> (酶)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 936d00e...371590a. Read the comment docs.

@JoshKarpel
Copy link
Contributor Author

- id: python-use-type-annotations
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/asottile/blacken-docs
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@darrenburns
Copy link
Owner

There's a lot of conflicts here but I suspect a git checkout --theirs . (followed by ensuring the hooks run again) would be enough to resolve them all since most of the changes here are automatically generated?

@darrenburns darrenburns mentioned this pull request May 25, 2021
@darrenburns
Copy link
Owner

@JoshKarpel #217 is now merged. I've fixed the conflicts here and pre-commit is passing in this PR now.

Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com>
@JoshKarpel JoshKarpel marked this pull request as ready for review May 25, 2021 20:21
@JoshKarpel
Copy link
Contributor Author

@JoshKarpel #217 is now merged. I've fixed the conflicts here and pre-commit is passing in this PR now.

Final cleanup done!

@darrenburns
Copy link
Owner

Yay, thanks! 馃帀

@darrenburns darrenburns merged commit 3bc5de8 into darrenburns:master May 25, 2021
@JoshKarpel JoshKarpel deleted the pre-commit branch May 25, 2021 20:39
mkuyper added a commit to mkuyper/ward that referenced this pull request Aug 19, 2021
* 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)
  ...
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.

None yet

3 participants