Skip to content

Commit

Permalink
Pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Nov 3, 2023
1 parent e47dd55 commit 1c0c360
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint sources
run-name: Lint sources

on:
push:
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint sources
run: |
pip install pre-commit
pre-commit run --all-files
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace-fixer
- id: end-of-file-fixer
- id: check-json
- id: check-yaml
- id: double-quote-string-fixer
- id: check-shebang-scripts-are-executable
- id: check-executables-have-shebangs
- id: detect-private-key
- id: detect-aws-credentials
repos:
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
- id: script-must-have-extension
- id: git-dirty
- id: git-check
- id: forbid-binary
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Contributing

Contributions are welcome. All contributed code will be covered by the Apache License v2 of this project.

## Linting

The CI uses [pre-commit](https://pre-commit.com/) to lint all code within the repo. Add it to your local
copy with `pip install pre-commit` and `pre-commit install`.

0 comments on commit 1c0c360

Please sign in to comment.