Skip to content

Commit 5109be8

Browse files
committed
ci(pre-commit): Add check for bash scripts
1 parent c7022ca commit 5109be8

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.pre-commit-config.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ repos:
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
1515
rev: "v4.5.0"
1616
hooks:
17+
# Generic checks
1718
- id: check-case-conflict
1819
- id: check-symlinks
1920
- id: debug-statements
@@ -25,6 +26,8 @@ repos:
2526
args: [--fix=lf]
2627
- id: trailing-whitespace
2728
args: [--markdown-linebreak-ext=md]
29+
30+
# JSON formatting
2831
- id: pretty-format-json
2932
stages: [manual]
3033
args: [--autofix]
@@ -35,40 +38,52 @@ repos:
3538
package\.json$|
3639
^package\/.*$
3740
)
41+
3842
- repo: https://github.com/codespell-project/codespell
3943
rev: "v2.3.0"
4044
hooks:
45+
# Spell checking
4146
- id: codespell
4247
exclude: ^.*\.(svd|SVD)$
48+
4349
- repo: https://github.com/pre-commit/mirrors-clang-format
4450
rev: "v18.1.3"
4551
hooks:
52+
# C/C++ formatting
4653
- id: clang-format
4754
types_or: [c, c++]
4855
exclude: ^.*\/build_opt\.h$
56+
4957
- repo: https://github.com/psf/black-pre-commit-mirror
5058
rev: "22.10.0"
5159
hooks:
60+
# Python formatting
5261
- id: black
5362
types_or: [python]
5463
args: [--line-length=120] #From the arduino code style. Add as argument rather than creating a new config file.
64+
5565
- repo: https://github.com/PyCQA/flake8
5666
rev: "7.0.0"
5767
hooks:
68+
# Python linting
5869
- id: flake8
5970
types_or: [python]
6071
additional_dependencies:
6172
- flake8-bugbear
6273
- flake8-comprehensions
6374
- flake8-simplify
75+
6476
- repo: https://github.com/pre-commit/mirrors-prettier
6577
rev: "v3.1.0"
6678
hooks:
79+
# YAML formatting
6780
- id: prettier
6881
types_or: [yaml]
82+
6983
- repo: https://github.com/errata-ai/vale
7084
rev: "v3.0.7"
7185
hooks:
86+
# Sync vale styles and lint markdown and reStructuredText
7287
- id: vale
7388
name: vale-sync
7489
language_version: "1.21.6"
@@ -78,3 +93,19 @@ repos:
7893
- id: vale
7994
language_version: "1.21.6"
8095
types_or: [markdown, rst]
96+
97+
- repo: https://github.com/shellcheck-py/shellcheck-py
98+
rev: "v0.10.0.1"
99+
hooks:
100+
# Bash linting
101+
- id: shellcheck
102+
types: [shell]
103+
args: ["--severity=warning"]
104+
105+
- repo: https://github.com/openstack/bashate
106+
rev: "2.1.1"
107+
hooks:
108+
# Bash formatting
109+
- id: bashate
110+
types: [shell]
111+
args: ["-i", "E006"] # Ignore E006: Line too long

.shellcheckrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Shellcheck configuration file for ESP32 Arduino core
2+
3+
# Optional checks. https://github.com/koalaman/shellcheck/wiki/optional
4+
enable=add-default-case,deprecate-which,avoid-nullary-conditions
5+
6+
# Enable search for external sources
7+
external-sources=true
8+
9+
# Search folder for sourced files
10+
source-path=SCRIPTDIR/../..

0 commit comments

Comments
 (0)