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

Set up pre-commit for running hooks and tasks such as linting. #11

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jacksonj04
Copy link
Member

@jacksonj04 jacksonj04 commented Mar 21, 2024

pre-commit is a cross-language framework for managing pre-commit hooks. This PR adds the necessary configuration and documentation changes, and then whips existing files into shape.

Specifically, this is configured to:

  • Make sure lines don't have trailing whitespace
  • Make sure the last line in a file is empty
  • Check JSON and YAML files are syntactically valid
  • Prevent files over 500kb (configurable) from being committed
  • Run the prettier code formatter over scss, yaml, markdown and js files
  • Run dotnet format across the codebase

Developers can install pre-commit in several ways, including through pip, homebrew and conda. Once that's done, running pre-commit install in the directory will set up the necessary git hooks.

[pre-commit](https://pre-commit.com/) is a cross-language framework for managing pre-commit hooks. This sample file sets up some very basic checks to enforce things like no trailing whitespace, and the last line in a file being blank.
@jacksonj04 jacksonj04 marked this pull request as ready for review March 28, 2024 14:32
@jacksonj04
Copy link
Member Author

@dynamictulip @lookupdaily @jkempster34 we should investigate doing this with something like https://alirezanet.github.io/Husky.Net/

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