-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add prettier and pygrep hooks to pre-commit hooks #9644
Conversation
Overall looks great! We should check some of those, I added a couple of comments, though not a complete review. To the extent that some might interfere with The markdown & rst checkers look overall great! |
.pre-commit-config.yaml
Outdated
- repo: https://github.com/executablebooks/mdformat | ||
rev: 0.7.18 | ||
hooks: | ||
- id: mdformat |
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.
apparently, we can fix (some of) the surprising bracket escapes with
- id: mdformat | |
- id: mdformat | |
additional_dependencies: [mdformat-gfm] |
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.
though I wonder if instead of using mdformat
we should rely on prettier
to format markdown, as that can also format json
and yaml
?
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.
FWIW in prql we quite successfully use prettier
to format all non-core code, including yaml / json / md; would recommend: https://github.com/PRQL/prql/blob/86becc591eb1a6421695ccccdf67dd8ab5c775ec/.pre-commit-config.yaml#L18-L22
...and it has a nice VS Code extension (and I guess emacs for the pros among us...)
Why don't we instead try to rely on ruff and enable these rules there? |
Definitely preferable for the python ones. (though formatting non-python files would still be part of this sort of effort...) |
90ea56e
to
522e28d
Compare
Thank you for all your comments, I switched to |
522e28d
to
2537fbf
Compare
Co-authored-by: Justus Magin <[email protected]>
* main: (24 commits) Bump minimum versions (#9796) Namespace-aware `xarray.ufuncs` (#9776) Add prettier and pygrep hooks to pre-commit hooks (#9644) `rolling.construct`: Add `sliding_window_kwargs` to pipe arguments down to `sliding_window_view` (#9720) Bump codecov/codecov-action from 4.6.0 to 5.0.2 in the actions group (#9793) Buffer types (#9787) Add download stats badges (#9786) Fix open_mfdataset for list of fsspec files (#9785) add 'User-Agent'-header to pooch.retrieve (#9782) Optimize `ffill`, `bfill` with dask when `limit` is specified (#9771) fix cf decoding of grid_mapping (#9765) Allow wrapping `np.ndarray` subclasses (#9760) Optimize polyfit (#9766) Use `map_overlap` for rolling reductions with Dask (#9770) fix html repr indexes section (#9768) Bump pypa/gh-action-pypi-publish from 1.11.0 to 1.12.2 in the actions group (#9763) unpin array-api-strict, as issues are resolved upstream (#9762) rewrite the `min_deps_check` script (#9754) CI runs ruff instead of pep8speaks (#9759) Specify copyright holders in main license file (#9756) ...
Towards #8239. This mainly addresses problems in rst and markdown files.