10000 Add autoupdate for pre-commit hook versions by cyschneck · Pull Request #604 · NCAR/geocat-comp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add autoupdate for pre-commit hook versions #604

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

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

cyschneck
Copy link
Contributor
@cyschneck cyschneck commented Apr 23, 2024

PR Summary

Closes #603

PR Checklist

General

  • Make an issue if one doesn't already exist
  • Link the issue this PR resolves by adding closes #XXX to the PR description where XXX is the number of the issue.
  • Add a brief summary of changes to docs/release-notes.rst in a relevant section for the next unreleased release. Possible sections include: Documentation, New Features, Bug Fixes, Internal Changes, Breaking Changes/Deprecated
  • Add appropriate labels to this PR
  • Make your changes in a forked repository rather than directly in this repo
  • Open this PR as a draft if it is not ready for review
  • Convert this PR from a draft to a full PR before requesting reviewers
  • Passes precommit. To set up on your local, run pre-commit install from the top level of the repository. To manually run pre-commits, use pre-commit run --all-files and re-add any changed files before committing again and pushing.
  • If needed, squash and merge PR commits into a single commit to clean up commit history

@cyschneck cyschneck added the refactor Internal code refactoring label Apr 23, 2024
@cyschneck cyschneck self-assigned this Apr 23, 2024
@cyschneck
Copy link
Contributor Author
cyschneck commented Apr 23, 2024

@anissa111 is the meta.yaml file still being used in this repo? I didn't see it, but it is referenced in the pre-commit

-   repo: https://github.com/pre-commit/pre-commit-hooks    # Some common pre-commit hooks
    rev: v4.6.0
    hooks:
    - id: check-yaml               # Checks the syntax of .yaml files.
      args: [--allow-multiple-documents]
      exclude: 'meta.yaml'    # Exclude this because it gives an error for '%' in Line 1 and couldn't fix yet
    - id: end-of-file-fixer        # Makes sure files end with a newline.
    - id: trailing-whitespace      # Checks for any tabs or spaces after the last non-whitespace character on the line.
- id: check-docstring-first # Checks that code comes after the docstrings.

@anissa111
Copy link
Member

@anissa111 is the meta.yaml file still being used in this repo? I didn't see it, but it is referenced in the pre-commit

-   repo: https://github.com/pre-commit/pre-commit-hooks    # Some common pre-commit hooks
    rev: v4.6.0
    hooks:
    - id: check-yaml               # Checks the syntax of .yaml files.
      args: [--allow-multiple-documents]
      exclude: 'meta.yaml'    # Exclude this because it gives an error for '%' in Line 1 and couldn't fix yet
    - id: end-of-file-fixer        # Makes sure files end with a newline.
    - id: trailing-whitespace      # Checks for any tabs or spaces after the last non-whitespace character on the line.
- id: check-docstring-first # Checks that code comes after the docstrings.

Ah, yeah, nope! At one time, we did use a meta.yaml, but that line must have lingered after we refactored the packaging.

@cyschneck
Copy link
Contributor Author

As part of this refresh I'll remove it

@anissa111
Copy link
Member

I'm also kind of suprised that we didn't have this set up to autoupdate. I assumed dependabot was doing something like this, but apparently that's not something dependabot is set up to do.

I think we should consider setting up pre-commit.ci. I'm not sure if that's actually doable with the github org structure/permissions, but it's worth looking into.

We could also theoretically just add a pre-commit autoupdate push somewhere in our CI as suggested here if pre-commit.ci isn't possible.

@anissa111 anissa111 added developer feature For development standardization / best practices / enhancement dependencies Pull requests that update a dependency file testing Issue related to testing and removed refactor Internal code refactoring labels Apr 23, 2024
@cyschneck
Copy link
Contributor Author

Will do. I'll update it to include the autoupdate-r

@cyschneck cyschneck marked this pull request as ready for review April 24, 2024 18:56
@cyschneck cyschneck requested a review from anissa111 April 24, 2024 18:57
Copy link
Member
@anissa111 anissa111 left a comment

Choose a reason for hiding this comment

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

So I was a bit worried about just adding the ci step there because I didn't know if we could use pre-commit.ci, but a number of other NCAR repos are already doing so!

I've added geocat-comp to pre-commit.ci, which should allow the changes here to work as expected.

See the additional action run in this test PR: #605

image

@anissa111 anissa111 changed the title Refresh pre-commit hook versions Add autoupdate for pre-commit hook versions Apr 24, 2024
@anissa111
Copy link
Member

With this, we should remove the github action based pre-commit check.

@anissa111 anissa111 self-requested a review April 24, 2024 21:16
@anissa111 anissa111 merged commit ada6607 into NCAR:main Apr 24, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file developer feature For development standardization / best practices / enhancement testing Issue related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refresh pre-commit hook versions
2 participants
0