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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit #1295

Merged
merged 4 commits into from
Oct 23, 2023
Merged

Add pre-commit #1295

merged 4 commits into from
Oct 23, 2023

Conversation

ianthomas23
Copy link
Member

@ianthomas23 ianthomas23 commented Oct 20, 2023

This adds pre-commit to the repo and CI, following a similar approach to that in HoloViews. The initial setup is relatively simple, and we can extend it over time. It includes some of the standard pre-commit hooks as well as codespell and ruff.

It uses the default set of ruff checks, and I have fixed all reported errors. These are in the following categories:

  1. Line length. I have set the max line length to 100 so that there aren't too many changes, and I expect in time the various HoloViz repos will converge on a common value.
  2. Multiple statements on one line.
  3. No bare except.
  4. Ambiguous variable name l.
  5. Module level imports not at top of file.
  6. Use def rather than assigning a lambda.
  7. Use a not in b rather than not a in b.

None of these changes should be controversial, but I accept that this PR is rather large so it may not be acceptable as it is.

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #1295 (413c257) into main (81ce9b8) will decrease coverage by 0.03%.
The diff coverage is 88.63%.

@@            Coverage Diff             @@
##             main    #1295      +/-   ##
==========================================
- Coverage   85.66%   85.63%   -0.03%     
==========================================
  Files          52       52              
  Lines       11114    11128      +14     
==========================================
+ Hits         9521     9530       +9     
- Misses       1593     1598       +5     

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general types of changes are fine. I would go blind if I tried to review each line and make sure that it hasn't changed, so I'll have to rely on your assurance that you have done so (or you can pick a victim to help review that for you. :-)). Thanks!

@ianthomas23 ianthomas23 merged commit d338d98 into main Oct 23, 2023
14 checks passed
@ianthomas23 ianthomas23 deleted the pre-commit branch October 23, 2023 09:07
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.

2 participants