Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768833
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..786f5da
--- /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
index 5176062..adf22d4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,55 +1,58 @@
# -------------------------------------------------------------
# Salt - Operations repository
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Allow to generate repository or API content
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
HOST_NAME != hostname -s
HOST_DOMAIN != hostname -d
API_DIR=/var/wwwroot/$(HOST_DOMAIN)/$(HOST_NAME)/datasources/infra
RM=rm -f
MKDIR=mkdir -p
MV=mv
# -------------------------------------------------------------
# Main targets
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_default: repo
all: repo api
clean: clean-repo clean-api
test:
(cd _tests && make)
# -------------------------------------------------------------
# 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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
api: $(API_DIR)/all-states.json
$(API_DIR)/all-states.json:
${MKDIR} ${API_DIR}
utils/show-local-states.py > ${API_DIR}/all-states.json
clean-api:
${RM} ${API_DIR}/all-states.json
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 10:51 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260033
Default Alt Text
(2 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment