Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3745274
D2635.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D2635.diff
View Options
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,34 @@
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.1.0
+ hooks:
+ - id: check-added-large-files
+ - id: check-executables-have-shebangs
+ - id: check-json
+ - id: check-merge-conflict
+ - id: check-xml
+ - id: check-yaml
+ - id: end-of-file-fixer
+ exclude: ^roles/core/motd/files/
+ - id: fix-byte-order-marker
+ - id: mixed-line-ending
+ args: ["--fix=lf"]
+ - id: trailing-whitespace
+ exclude: patch$
+
+ - repo: https://github.com/psf/black
+ rev: 22.1.0
+ hooks:
+ - id: black
+
+ - repo: https://github.com/warpnet/salt-lint
+ rev: v0.8.0
+ hooks:
+ - id: salt-lint
+ args: ["-x", "207,208"]
+ files: ^(roles|hotfixes).*\.(sls)$
+
+ - repo: https://devcentral.nasqueron.org/source/codestyle.git
+ rev: v0.1.0
+ hooks:
+ - id: shellcheck
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -31,15 +31,18 @@
# Build targets - repository
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-repo: roles/webserver-content/init.sls
+repo: roles/webserver-content/init.sls .git/hooks/pre-commit
roles/webserver-content/init.sls:
tmpfile=`mktemp /tmp/make-rOPS-generate-webcontent-index.XXXXXX` ; \
utils/generate-webcontent-index.py > "$$tmpfile" ;\
${MV} "$$tmpfile" roles/webserver-content/init.sls
+.git/hooks/pre-commit:
+ pre-commit install
+
clean-repo:
- ${RM} roles/webserver-content/init.sls
+ ${RM} roles/webserver-content/init.sls .git/hooks/pre-commit
# -------------------------------------------------------------
# Build targets - API
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 13:39 (21 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247604
Default Alt Text
D2635.diff (1 KB)
Attached To
Mode
D2635: Enable pre-commit
Attached
Detach File
Event Timeline
Log In to Comment