folbricht / desync

Alternative casync implementation
BSD 3-Clause "New" or "Revised" License
336 stars 44 forks source link

Adds basic pre-commit #260

Closed bearrito closed 6 months ago

bearrito commented 7 months ago

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 commented 7 months ago

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