원클릭으로
fix-linter-test
// Debug and fix a failing MegaLinter linter test. Use when a linter test fails in CI or locally.
// Debug and fix a failing MegaLinter linter test. Use when a linter test fails in CI or locally.
Add a new MegaLinter flavor (language-specific Docker image). Use when creating a new specialized Docker image variant.
Guided workflow for adding a new linter to MegaLinter. Use when a contributor needs to add support for a new linting tool.
Add a new output reporter to MegaLinter. Use when adding support for a new CI system or output format.
Gather requirements for a MegaLinter change by asking clarifying questions until the problem is fully understood. First step of the contribution workflow.
Design a MegaLinter solution and write a technical specification. Second step of the contribution workflow, use after /analyze.
Diagnose MegaLinter .mega-linter.yml configuration issues. Use when linters aren't running as expected or configuration seems wrong.
| name | fix-linter-test |
| description | Debug and fix a failing MegaLinter linter test. Use when a linter test fails in CI or locally. |
| allowed-tools | Read Grep Glob Bash Edit |
| argument-hint | ["linter-name-or-test-output"] |
| model | sonnet |
Debug the failing test for $ARGUMENTS.
Steps:
megalinter/tests/test_megalinter/linters/@generated by .automation/build.py header) — if so, fix the descriptor YAML or fixtures, NOT the test file itselfmegalinter/descriptors/ to understand expected behavior (cli_lint_mode, config_file_name, cli_lint_errors_regex, file_extensions).automation/test/<test_folder>/:
cli_lint_errors_regexfile_extensions or file_names_regex in the descriptormegalinter/linters/, review it for issuesfile_extensionscli_lint_errors_regex doesn't match actual linter output formatconfig_file_namecli_lint_mode mismatch (file vs list_of_files vs project)LINTER="<descriptor_id_lowercase>_<linter_name>"
docker buildx build --platform linux/amd64 --file linters/$LINTER/Dockerfile --tag $LINTER .
docker run --rm --env TEST_CASE_RUN=true --env OUTPUT_DETAIL=detailed \
--env TEST_KEYWORDS="${LINTER}_test" --env MEGALINTER_VOLUME_ROOT="." \
--volume "$(pwd):/tmp/lint" $LINTER
To run only a specific test method (e.g., test_failure):
--env TEST_KEYWORDS="${LINTER}_test and test_failure"
TEST_KEYWORDS=<linter>_testCHANGELOG.md only if the fix changes user-visible linter behavior (wrong error count, missed files, broken output). Add one line under Fixes in the beta section:
- Fix <linter-name>: <what was wrong and what users now get>
Do NOT add an entry for test-infrastructure-only fixes (fixture paths, test class regeneration, etc.).