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 #6

Open
vesnikos opened this issue Jun 23, 2023 · 0 comments
Open

Add pre-commit hooks #6

vesnikos opened this issue Jun 23, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request qc Quality Control

Comments

@vesnikos
Copy link
Member

See https://pre-commit.com/ website and various other technical sites for a more full description

Pre-commit hooks are scripts or actions that are run automatically before a commit is made to a version control system, such as Git. They serve as a quality control mechanism by allowing you to enforce certain checks and standards on the codebase before it is committed. Here are some reasons why including pre-commit hooks in a project can be beneficial:

  1. Consistency
  2. Code quality
  3. Time savings
  4. Continuous Integration
  5. Codebase maintenance
  6. collaboration

at the very minimun pre-commit hooks should apply code styling rules and file checking

see https://pre-commit.com/hooks.html for a list of pre-defined hooks (mirrors-prerrier for js)

other hooks could be:

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.1.0
    hooks:
      - id: check-added-large-files # prevents giant files from being committed.
      - id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
      - id: check-merge-conflict # checks for files that contain merge conflict strings.
      - id: check-yaml # checks yaml files for parseable syntax.
      - id: detect-private-key # detects the presence of private keys.
      - id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline.
      - id: fix-byte-order-marker # removes utf-8 byte order marker.
      - id: mixed-line-ending # replaces or checks mixed line ending.
      - id: requirements-txt-fixer # sorts entries in requirements.txt.
      - id: trailing-whitespace # trims trailing whitespace.
@vesnikos vesnikos added the qc Quality Control label Jun 23, 2023
@andy-clarke-uofg andy-clarke-uofg added the enhancement New feature or request label Jul 13, 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 qc Quality Control
Projects
None yet
Development

No branches or pull requests

2 participants