-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add pre-commit * chore: add read permission to gh actions * chore: apply pre-commit * chore: add pre-commit CI
- Loading branch information
Showing
86 changed files
with
650 additions
and
556 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Pre-commit | ||
|
||
on: | ||
push: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
pre-commit: | ||
name: Run pre-commit | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: pre-commit/action@v3.0.1 | ||
with: | ||
extra_args: --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
repos: | ||
|
||
# Checkov | ||
- repo: https://github.com/bridgecrewio/checkov | ||
rev: 3.2.245 | ||
hooks: | ||
- id: checkov | ||
name: checkov | ||
description: "Static code analysis for security and compliance" | ||
files: .+ | ||
verbose: false | ||
|
||
# Pip Audit | ||
- repo: https://github.com/pypa/pip-audit | ||
rev: v2.7.3 | ||
hooks: | ||
- id: pip-audit | ||
name: pip-audit | ||
description: "Audits Python environments and dependency trees for known vulnerabilities" | ||
entry: pip-audit | ||
pass_filenames: false | ||
language: python | ||
|
||
# Generic | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
name: fix end of files | ||
description: "Ensures that a file is either empty, or ends with one newline" | ||
entry: end-of-file-fixer | ||
types: [ text ] | ||
stages: [ commit, push, manual ] | ||
language: python | ||
|
||
- id: trailing-whitespace | ||
name: trim trailing whitespace | ||
description: "Trims trailing whitespace" | ||
entry: trailing-whitespace-fixer | ||
types: [ text ] | ||
stages: [ commit ] | ||
language: python | ||
|
||
# TOML | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-toml | ||
name: check toml | ||
description: "Checks .toml files for parseable syntax" | ||
entry: check-toml | ||
types: [toml] | ||
language: python | ||
|
||
# YAML | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-yaml | ||
name: check yaml | ||
description: "Checks .yaml files for parseable syntax" | ||
entry: check-yaml | ||
types: [ yaml ] | ||
language: python | ||
|
||
# YAPF | ||
- repo: https://github.com/google/yapf | ||
rev: v0.40.2 | ||
hooks: | ||
- id: yapf | ||
name: yapf | ||
description: "A formatter for Python files" | ||
entry: yapf | ||
args: [ -i ] # inplace | ||
language: python | ||
types: [ python ] | ||
additional_dependencies: [ toml ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
"eeyore.yapf", | ||
"streetsidesoftware.code-spell-checker", | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ | |
"docs/*" | ||
], | ||
"esbonio.sphinx.confDir": "${workspaceFolder}/docs/source" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.