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

Adds basic pre-commit #260

Merged
merged 1 commit into from
Mar 10, 2024
Merged

Conversation

bearrito
Copy link
Contributor

@bearrito bearrito commented Mar 6, 2024

I continually forget to do things before commit, in most projects I rely on pre-commit (maybe to my detriment).

This adds a basic pre-commit script. https://pre-commit.com/
This is completely opt in. If a user doesn't use pre-commit. Then nothing happens locally or in ci.

I only selected the least opinionated of all available hooks. I left the opinionated hooks in, if those are something you'd want for the project.

The unit test hook is currently commented out because of a failing cmd unit-test. It should be re-enabled.

bearrito@home:~/Git/desync/cmd/desync$ pre-commit run
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/bstrausser/.cache/pre-commit/patch1709692795-3024168.
[WARNING] The 'rev' field of repo 'https://github.com/dnephin/pre-commit-golang' appears to be a mutable reference (moving tag / branch).  Mutable references are never updated after first install and are not supported.  See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details.  Hint: `pre-commit autoupdate` often fixes this.
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for added large files..............................................Passed
go fmt...................................................................Passed
go-build.................................................................Passed
go-mod-tidy..............................................................Passed

@bearrito
Copy link
Contributor Author

bearrito commented Mar 6, 2024

I don't believe anything in this commit should be making the build fail, nor the windows build specifically.

@folbricht folbricht merged commit bfeeb2f into folbricht:master Mar 10, 2024
3 checks passed
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