Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Add pre-commit action #4

Merged
merged 4 commits into from
Jun 9, 2022
Merged

Add pre-commit action #4

merged 4 commits into from
Jun 9, 2022

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Jun 9, 2022

No description provided.

pre-commit/action.yml Outdated Show resolved Hide resolved
Comment on lines +1 to +2
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming this file is just a dummy example?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, but it is run/applied to the repo.

Comment on lines +5 to +8
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
Copy link
Member

Choose a reason for hiding this comment

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

From the above, other useful generic ones (full list here):

  • check-case-conflict
  • check-executables-have-shebangs
  • check-merge-conflict
  • mixed-line-ending with args: [--fix=lf] for Windows users

@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
rev: v3.2.0
rev: v4.1.0

Copy link
Member Author

Choose a reason for hiding this comment

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

I enabled dependabot for this repo, so it should take care of opening PRs for verison updates

Copy link
Member

Choose a reason for hiding this comment

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

Dependabot doesn't support pre-commit dependabot/dependabot-core#1524

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh woops, I thought this was a github actions file (not sure why). Is there something else I can use to update all the versions locally, or do I have to go through each one manually?

Copy link
Member

Choose a reason for hiding this comment

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

You can run pre-commit autoupdate. Not sure of a way of automating it. I just run that command every now and then.

Copy link
Member Author

Choose a reason for hiding this comment

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

I found pre-commit autoupdate 😄

@dstansby dstansby merged commit 7a82447 into main Jun 9, 2022
@dstansby dstansby deleted the pre-commit branch June 9, 2022 15:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants