Loading...
Loading...
Selects, configures, and integrates a static analysis tool for the project's language. Covers tool selection, rule configuration, CI integration, fixing existing violations, and pre-commit hook setup. Invoked when the user asks to add linting, set up static analysis, or configure a code quality tool.
npx skill4agent add soulcodex/agentic static-code-analysis| Language | Recommended tool | Config file |
|---|---|---|
| TypeScript / JavaScript | ESLint + typescript-eslint (+ eslint-plugin-import if using | |
| Go | golangci-lint | |
| Python | Ruff | |
| PHP | PHPStan | |
| Rust | Clippy (built-in) | |
import/*eslint-plugin-import{
"rules": {
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unused-vars": "error",
"import/no-commonjs": "error",
"no-console": "warn",
"eqeqeq": ["error", "always"]
}
}linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
linters-settings:
govet:
enable-all: true[tool.ruff]
select = ["E", "F", "I", "N", "UP", "S", "B"]
ignore = []
line-length = 100# .github/workflows/ci.yml
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run linter
run: <lint-command> # e.g., pnpm lint, golangci-lint run, ruff check .continue-on-error: true# TypeScript
pnpm eslint . --fix
# Python
ruff check . --fix
# Go (no auto-fix in golangci-lint; use gofmt + goimports)
gofmt -w .
goimports -w .error// eslint-disable-next-line @typescript-eslint/no-explicit-any -- legacy API response type
const response: any = await legacyClient.fetch()git pushpnpm add -D husky lint-staged
npx husky init// package.json
"lint-staged": { "*.{ts,tsx}": "eslint --fix" }# .pre-commit-config.yaml
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.0
hooks:
- id: ruff
args: [--fix]<lint-command>eslint-disable#noqa