Skip to content

Commit

Permalink
Merge pull request #3 from 7pandeys/feature/Add-precommit
Browse files Browse the repository at this point in the history
Add .pre-commit-config.yaml
  • Loading branch information
7pandeys authored Dec 10, 2023
2 parents 3f0a9ef + 6f58181 commit a2d54ac
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:

# pre-commit checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace # Removes extra whitespaces in the code
- id: end-of-file-fixer # Adds empty string at the end of file
- id: check-yaml # Checks structure of all yaml files
- id: detect-private-key # Checks for the presence of private key getting accidentally committed
- id: check-merge-conflict # Checks for the presence of merge conflicts in code files
- id: check-added-large-files # Ensures no large files are committed by default
- id: check-case-conflict # Checks for case-conflicting filenames in codebase

# black - black code formatter to format the Python code automatically
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
args: [--line-length=120]

# ruff - ruff code linting framework
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.287
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix, --ignore=E501 ]

0 comments on commit a2d54ac

Please sign in to comment.