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 hook for Linting #276

Merged
merged 9 commits into from
Mar 17, 2023
Merged

Conversation

phillipbarron
Copy link
Contributor

What does this change?

This PR adds a pre-commit hook which will auto format staged changes using ScalaFMT. It also adds a setup script whose role is sym-linking the script to the hooks dir.

How to test

Check it out, run the script, make a change and commit. The linter should run against your Scala files.

How can we measure success?

Have we considered potential risks?

Yep

Images

@phillipbarron phillipbarron requested a review from a team as a code owner March 17, 2023 11:53
@twrichards
Copy link

Ahhh inspired by your positive experiences of https://github.com/guardian/pinboard 😜

Copy link
Contributor

@jonathonherbert jonathonherbert left a comment

Choose a reason for hiding this comment

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

Tested locally, great! Worth running ./setup-hooks in ./setup, so everyone new to the project gets the hooks?

script/hooks/pre-commit Outdated Show resolved Hide resolved
script/hooks/pre-commit Outdated Show resolved Hide resolved
phillipbarron and others added 2 commits March 17, 2023 13:34
Co-authored-by: Jonathon Herbert <jonathon.herbert@guardian.co.uk>
Co-authored-by: Jonathon Herbert <jonathon.herbert@guardian.co.uk>
@phillipbarron
Copy link
Contributor Author

phillipbarron commented Mar 17, 2023

Tested locally, great! Worth running ./setup-hooks in ./setup, so everyone new to the project gets the hooks?

Cheers - that was my plan as I had a memory of there being a setup script, but I don't see one 🤷

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.

None yet

3 participants