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

feat: add pre-commit configuration and install in devcontainer #113

Merged
merged 10 commits into from
Jan 27, 2024

Conversation

tallaxes
Copy link
Collaborator

@tallaxes tallaxes commented Jan 26, 2024

Description

Add pre-commit configuration file and a feature to have pre-commit in devcontainer / Codespace. The configuration includes the following hooks (the selection is based on security concerns + commonly observed issues):

  • gitleaks - prevention of checking in secrets
  • golangci-lint
  • shellcheck
  • typos - spellchecker (and a compatible VSCode plugin)
  • end-of-file-fixer
  • trailing-whitespace

Note that these run only on the changed files.

The pre-commit failure experience in VSCode is not great - it will usually show up as "modified files" popup, and one needs to look at the new changes or Git log - but pre-commit finding something is supposed to be rare, so deemed acceptable.

How was this change tested?

  • Creating a file with something that pre-commit will catch, and trying to commit

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note


@coveralls
Copy link

coveralls commented Jan 26, 2024

Pull Request Test Coverage Report for Build 7676701732

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 97.626%

Totals Coverage Status
Change from base Build 7675929552: 0.0%
Covered Lines: 35605
Relevant Lines: 36471

💛 - Coveralls

Copy link
Collaborator

@Bryce-Soghigian Bryce-Soghigian left a comment

Choose a reason for hiding this comment

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

Pre-commit hook is an easy win, although I suspect that anyone developing wtihout that precommit hook wiill push things caught by the hook(IE upstream compatibility spelling error.

@tallaxes tallaxes self-assigned this Jan 26, 2024
@tallaxes tallaxes added the area/devtools Issues or PRs related to devtools label Jan 26, 2024
@tallaxes tallaxes added the area/security Issues or PRs related to security label Jan 27, 2024
@tallaxes tallaxes merged commit fb5a433 into main Jan 27, 2024
9 checks passed
@tallaxes tallaxes deleted the tallaxes/pre-commit branch January 27, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues or PRs related to devtools area/security Issues or PRs related to security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants