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 hooks to Unguard #25

Open
6 tasks
ammerzon opened this issue Jan 9, 2023 · 0 comments
Open
6 tasks

Add pre-commit hooks to Unguard #25

ammerzon opened this issue Jan 9, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ammerzon
Copy link
Contributor

ammerzon commented Jan 9, 2023

We're considering adding pre-commit to our project to help ensure that the code we commit to our repository is high quality. Pre-commit is a tool that allows us to define a set of checks that are run on our code every time we try to commit changes. These checks can include linting, formatting, and testing and help catch issues before they're committed to the repository.

Definition of Done

  • pre-commit hooks check the repository for each commit
  • The documentation explains how to use pre-commit

Tasks

  • Propose pre-commit hooks that are useful
  • Create the pre-commit configuration
  • Update the documentation to describe the usage of pre-commit
  • Test the hooks (pre-commit run --all-files)

Additional context

Example .pre-commit-config.yaml
default_install_hook_types:
- pre-commit
- commit-msg
repos:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
  rev: v9.1.0
  hooks:
    - id: commitlint
      stages: [commit-msg]
      additional_dependencies: ["@commitlint/config-conventional"]
- repo: https://github.com/pre-commit/mirrors-prettier
  rev: v2.7.1
  hooks:
    - id: prettier
      stages: [commit]
      name: "Format files with Prettier"
- repo: https://github.com/pre-commit/mirrors-eslint
  rev: v8.25.0
  hooks:
    - id: eslint
      stages: [commit]
      name: "Lint files with ESLint"
      files: \.[jt]sx?$
      types: [file]
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v4.3.0
  hooks:
    - id: check-case-conflict
    - id: check-json
    - id: check-xml
    - id: check-yaml
      args: [--allow-multiple-documents]
    - id: detect-aws-credentials
    - id: detect-private-key
    - id: end-of-file-fixer
    - id: mixed-line-ending
    - id: trailing-whitespace
      args: [--markdown-linebreak-ext=md]
@ammerzon ammerzon added enhancement New feature or request good first issue Good for newcomers labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant