-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ci): add static analysis tools (typos, taplo, hadolint, actionlint, shellcheck) #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
icook
wants to merge
4
commits into
master
Choose a base branch
from
enhance/243-static-analysis
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fcf355d
feat(ci): add static analysis tools (typos, taplo, hadolint, actionli…
icook 74df2e6
fix(ci): fix shellcheck issues in CI workflow
icook 994021a
fix: address PR review feedback
icook f39062d
refactor(ci): simplify static analysis to direct tool invocations
icook File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,14 @@ | ||
| self-hosted-runner: | ||
| labels: [] | ||
|
|
||
| # Configuration variables - null means disable check | ||
| config-variables: null | ||
|
|
||
| # Ignore shellcheck rules that are too noisy for CI scripts | ||
| # SC2086: Double quote to prevent globbing - often intentional in CI | ||
| # SC2129: Consider using grouped redirects - stylistic preference | ||
| paths: | ||
| .github/workflows/**/*.yml: | ||
| ignore: | ||
| - 'SC2086:.+' | ||
| - 'SC2129:.+' |
This file contains hidden or 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 hidden or 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,19 @@ | ||
| # Hadolint configuration | ||
| # https://github.com/hadolint/hadolint | ||
|
|
||
| # Treat warnings as errors in CI | ||
| failure-threshold: warning | ||
|
|
||
| ignored: | ||
| # Allow unpinned apt packages - we use base image version pinning instead | ||
| - DL3008 | ||
| # Allow cd in RUN commands - sometimes clearer than multiple WORKDIR switches | ||
| - DL3003 | ||
| # Allow unquoted variables for intentional word splitting (e.g., package lists) | ||
| - SC2086 | ||
| # Allow missing yarn cache clean in dev containers (not production) | ||
| - DL3060 | ||
|
|
||
| trustedRegistries: | ||
| - docker.io | ||
| - ghcr.io |
This file contains hidden or 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,11 @@ | ||
| # ShellCheck configuration | ||
| # https://www.shellcheck.net/ | ||
|
|
||
| # Only warn on actual issues, not style suggestions | ||
| # Severity levels: error, warning, info, style | ||
| severity=warning | ||
|
|
||
| # Common exclusions for GitHub Actions workflows: | ||
| # SC2086 - Double quote to prevent globbing (often intentional in CI) | ||
| # SC2129 - Consider using { cmd1; cmd2; } >> file (style preference) | ||
| disable=SC2086,SC2129 |
This file contains hidden or 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,15 @@ | ||
| # typos configuration | ||
| # https://github.com/crate-ci/typos | ||
|
|
||
| [default] | ||
| extend-ignore-re = [ | ||
| # Ignore hex strings and hashes | ||
| "[a-fA-F0-9]{32,}", | ||
| ] | ||
|
|
||
| [files] | ||
| extend-exclude = ["*.lock", "*.snap", ".sqlx/", "web/src/wasm/", "web/src/api/generated/"] | ||
|
|
||
| # Known false positives can be added here: | ||
| # [default.extend-words] | ||
| # ot = "ot" |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -320,6 +320,38 @@ audit-unused: | |
| lint: lint-backend lint-frontend | ||
| @echo "✓ All linting passed" | ||
|
|
||
| # ============================================================================= | ||
| # Static Analysis Tools | ||
| # ============================================================================= | ||
|
|
||
| # Run all static analysis checks | ||
| lint-static: lint-typos lint-toml lint-dockerfiles lint-workflows lint-scripts | ||
| @echo "✓ All static analysis passed" | ||
|
|
||
| # Check for typos in code and docs (requires typos: cargo install typos-cli) | ||
| lint-typos: | ||
| typos | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like these won't be setup by just setup |
||
|
|
||
| # Check TOML formatting (requires taplo: cargo install taplo-cli) | ||
| lint-toml: | ||
| taplo fmt --check | ||
|
|
||
| # Fix TOML formatting | ||
| fmt-toml: | ||
| taplo fmt | ||
|
|
||
| # Lint Dockerfiles (requires hadolint: brew install hadolint) | ||
| lint-dockerfiles: | ||
| hadolint service/Dockerfile service/Dockerfile.dev web/Dockerfile web/Dockerfile.dev dockerfiles/Dockerfile.postgres | ||
|
|
||
| # Lint GitHub Actions workflows (requires actionlint: brew install actionlint) | ||
| lint-workflows: | ||
| actionlint | ||
|
|
||
| # Lint shell scripts (requires shellcheck: brew install shellcheck) | ||
| lint-scripts: | ||
| shellcheck web/bin/*.sh web/scripts/*.sh service/bin/*.sh | ||
|
|
||
| # Fix all formatting (backend + frontend) | ||
| fmt: fmt-backend fmt-frontend | ||
| @echo "✓ All formatting applied" | ||
|
|
@@ -433,6 +465,13 @@ setup: | |
| @echo " - Docker: $(docker --version 2>/dev/null || echo "NOT INSTALLED")" | ||
| @echo " - kubectl: $(kubectl version --client 2>/dev/null | head -1 || echo "NOT INSTALLED")" | ||
| @echo "" | ||
| @echo "Static analysis tools (optional, for lint-static):" | ||
| @echo " - typos: $(typos --version 2>/dev/null || echo "NOT INSTALLED - cargo install typos-cli")" | ||
| @echo " - taplo: $(taplo --version 2>/dev/null || echo "NOT INSTALLED - cargo install taplo-cli")" | ||
| @echo " - hadolint: $(hadolint --version 2>/dev/null || echo "NOT INSTALLED - brew install hadolint")" | ||
| @echo " - actionlint: $(actionlint --version 2>/dev/null || echo "NOT INSTALLED - brew install actionlint")" | ||
| @echo " - shellcheck: $(shellcheck --version 2>/dev/null | head -2 | tail -1 || echo "NOT INSTALLED - brew install shellcheck")" | ||
| @echo "" | ||
| @echo "For local development (no cluster needed):" | ||
| @echo " just node-use # Switch to correct Node version (requires nvm)" | ||
| @echo " just lint # Lint all code" | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,25 @@ | ||
| # Taplo TOML formatter configuration | ||
| # https://taplo.tamasfe.dev/configuration/ | ||
|
|
||
| [formatting] | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. explain the false flags |
||
| # Don't vertically align = signs - keeps diffs minimal when adding entries | ||
| align_entries = false | ||
| array_auto_collapse = true | ||
| array_auto_expand = true | ||
| array_trailing_comma = true | ||
| column_width = 100 | ||
| compact_arrays = true | ||
| # Don't compact inline tables - keeps them readable on separate lines | ||
| compact_inline_tables = false | ||
| # Don't indent top-level entries - standard TOML style | ||
| indent_entries = false | ||
| # Don't indent table headers - keeps file structure flat and clear | ||
| indent_tables = false | ||
| inline_table_expand = true | ||
| # Don't reorder keys globally - preserves intentional grouping (e.g., comments above entries) | ||
| reorder_keys = false | ||
| trailing_newline = true | ||
|
|
||
| [[rule]] | ||
| keys = ["dependencies", "dev-dependencies", "build-dependencies"] | ||
| formatting = { reorder_keys = true } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can toss this, seems like bloat.