Skip to content

Commit 4c3219a

Browse files
committed
Add editorconfig, code of conduct and more linters
1 parent 3968579 commit 4c3219a

File tree

4 files changed

+288
-185
lines changed

4 files changed

+288
-185
lines changed

.editorconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with UTF-8 encoding
5+
[*]
6+
end_of_line = lf
7+
charset = utf-8
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
# Indentation for source and config files
12+
[*.{py,yml,yaml,json,js,ts,md,sh,txt}]
13+
indent_style = space
14+
indent_size = 4
15+
16+
# Markdown and JSON should not trim trailing spaces (needed for alignment)
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
# Shell scripts
21+
[*.sh]
22+
insert_final_newline = true
23+
24+
# Makefiles use tabs, not spaces
25+
[Makefile]
26+
indent_style = tab
27+
28+
# Ignore binary files
29+
[*.{png,jpg,jpeg,gif,ico,svg,webp,pyc}]
30+
insert_final_newline = false
31+
trim_trailing_whitespace = false

CODE_OF_CONDUCT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Code of Conduct
2+
3+
This project follows the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
4+
5+
By participating, you are expected to uphold this standard.

Makefile

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,41 @@ format-web: install-web-linters
496496
"mcpgateway/static/**/*.js"
497497

498498

499+
################################################################################
500+
# 🛡️ OSV-SCANNER ▸ vulnerabilities scanner
501+
################################################################################
502+
# help: osv-install - Install/upgrade osv-scanner (Go)
503+
# help: osv-scan-source - Scan source & lockfiles for CVEs
504+
# help: osv-scan-image - Scan the built container image for CVEs
505+
# help: osv-scan - Run all osv-scanner checks (source, image, licence)
506+
507+
.PHONY: osv-install osv-scan-source osv-scan-image osv-scan
508+
509+
osv-install: ## Install/upgrade osv-scanner
510+
go install github.com/google/osv-scanner/v2/cmd/osv-scanner@latest
511+
512+
# ─────────────── Source directory scan ────────────────────────────────────────
513+
osv-scan-source:
514+
@echo "🔍 osv-scanner source scan…"
515+
@osv-scanner scan source --recursive .
516+
517+
# ─────────────── Container image scan ─────────────────────────────────────────
518+
osv-scan-image:
519+
@echo "🔍 osv-scanner image scan…"
520+
@CONTAINER_CLI=$$(command -v docker || command -v podman) ; \
521+
if [ -n "$$CONTAINER_CLI" ]; then \
522+
osv-scanner scan image $(DOCKLE_IMAGE) || true ; \
523+
else \
524+
TARBALL=$$(mktemp /tmp/$(PROJECT_NAME)-osvscan-XXXXXX.tar) ; \
525+
podman save --format=docker-archive $(DOCKLE_IMAGE) -o "$$TARBALL" ; \
526+
osv-scanner scan image --archive "$$TARBALL" ; \
527+
rm -f "$$TARBALL" ; \
528+
fi
529+
530+
# ─────────────── Umbrella target ─────────────────────────────────────────────
531+
osv-scan: osv-scan-source osv-scan-image
532+
@echo "✅ osv-scanner checks complete."
533+
499534
# =============================================================================
500535
# 📡 SONARQUBE ANALYSIS (SERVER + SCANNERS)
501536
# =============================================================================
@@ -983,7 +1018,7 @@ docker-shell:
9831018
# help: compose-pull - Pull the latest images only
9841019
# help: compose-logs - Tail logs from all services (Ctrl-C to exit)
9851020
# help: compose-ps - Show container status table
986-
# help: compose-shell - Open an interactive shell in the gateway container
1021+
# help: compose-shell - Open an interactive shell in the "gateway" container
9871022
# help: compose-stop - Gracefully stop the stack (keep containers)
9881023
# help: compose-down - Stop & remove containers (keep named volumes)
9891024
# help: compose-rm - Remove *stopped* containers

0 commit comments

Comments
 (0)