Configs2026年7月25日·1 分钟阅读

Super-Linter — One Linter to Rule Them All in CI

Super-Linter is a GitHub Action that bundles dozens of linters and formatters into a single container. It automatically detects languages in your repository and runs the appropriate linters, supporting over 50 languages and formats out of the box.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 29/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Stage only
信任
信任等级:Established
入口
Super-Linter Overview
安全暂存命令
npx -y tokrepo@latest install ed3652a0-87c0-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

Introduction

Super-Linter is a GitHub Action maintained by the open-source community (originally created by GitHub) that packages over 50 linters into a single Docker container. It auto-detects the languages and file types in your repository and runs the matching linters, providing a one-step solution for enforcing code quality across polyglot projects.

What Super-Linter Does

  • Lints code in 50+ languages including Python, JavaScript, Go, Rust, Java, and Shell
  • Validates configuration files for YAML, JSON, XML, Terraform, Kubernetes, and Dockerfiles
  • Checks markdown, natural language prose, and documentation for style issues
  • Runs security-focused linters like Checkov, Trivy, and gitleaks alongside code linters
  • Reports results as inline annotations on GitHub pull requests

Architecture Overview

Super-Linter runs as a Docker container that bundles pre-installed linters with a Bash orchestration layer. On each run, it scans the repository file tree, maps file extensions to linter configurations, and invokes each linter in sequence. Results are collected and formatted as GitHub Actions annotations, appearing directly on changed files in pull request diffs.

Self-Hosting & Configuration

  • Add a single workflow YAML file to enable linting on push and pull request events
  • Set environment variables to enable or disable specific linters (e.g., VALIDATE_PYTHON=true)
  • Override default linter configurations by placing config files in the repository (e.g., .eslintrc, .pylintrc)
  • Use FILTER_REGEX_INCLUDE or FILTER_REGEX_EXCLUDE to limit which files are linted
  • Run the container locally with Docker for pre-push validation

Key Features

  • Zero configuration needed for basic usage — just add the workflow file
  • Supports linting only changed files in pull requests for faster CI runs
  • Slim image variant available for reduced container size and faster startup
  • Works with any CI system that supports Docker, not just GitHub Actions
  • Active community with regular updates to bundled linter versions

Comparison with Similar Tools

  • MegaLinter — similar multi-linter tool with a web reporting UI; Super-Linter is lighter and GitHub-native
  • pre-commit — runs hooks locally before commits; Super-Linter runs in CI after push
  • trunk — commercial dev tool with a managed linter suite; Super-Linter is fully open source
  • Reviewdog — posts lint results as PR comments; Super-Linter bundles linters and reporting together
  • SonarQube — deep analysis server with dashboards; Super-Linter is stateless and CI-first

FAQ

Q: Does Super-Linter slow down CI? A: Initial runs pull a large Docker image, but subsequent runs use cached layers. Linting only changed files speeds up PR checks.

Q: Can I use it outside GitHub Actions? A: Yes. Run the Docker container directly in any CI system (GitLab CI, Jenkins, CircleCI) or locally.

Q: How do I add a custom linter? A: Mount custom linter binaries into the container and configure them via environment variables. Community contributions for new linters are also welcome.

Q: Does it support auto-fixing? A: Super-Linter focuses on reporting issues. For auto-fixing, run the individual linters locally with their fix flags.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产