MegaLinter FILTER_REGEX_EXCLUDE excludes the whole .github/ tree via unanchored .git substring match
还没有人认领这个 Issue。
评估
调研方向
从 .mega-linter.yml 开始,检查 FILTER_REGEX_EXCLUDE 如何应用于相对路径。更新排除模式,然后按照 issue 中的说明,通过 Docker 对 .github/** 运行 actionlint、yamllint、markdownlint-cli2 和 editorconfig-checker。完成标准是 .github/** 在 lint 时没有新增发现,并且所有报告的问题都已清理。
由索引模型根据 Issue 内容生成。
描述
`FILTER_REGEX_EXCLUDE` in `.mega-linter.yml` is unanchored:
FILTER_REGEX_EXCLUDE: (\.git|\.venv|\.pytest_cache|\.vscode|__pycache__)
MegaLinter matches this regex against each file's full relative path. The `.git` alternative matches any path containing the substring `.git`, which also matches everything under `.github/` (e.g. `.github/workflows/mega-linter.yml`, `.github/labels.yml`, `.github/codeql.yml`). As a result the whole `.github/` tree is silently excluded from every linter — actionlint, yamllint, markdownlint, editorconfig-checker, etc. never see workflow files, label config, dependabot config, or issue templates.
Since this repo is the template other repos are scaffolded from, the bug propagates to every repo created from it.
Fix: anchor each alternative to real directory boundaries:
FILTER_REGEX_EXCLUDE: (^|/)(\.git|\.venv|\.pytest_cache|\.vscode|__pycache__)/
This keeps `.git/`, `.venv/`, `pycache/`, etc. excluded while no longer matching `.github/` as a false positive.
See laywill/laywill.github.io#48 and its fix in laywill/laywill.github.io#50 for the original writeup and verification approach (ran actionlint/yamllint/markdownlint-cli2/editorconfig-checker locally against `.github/**` via Docker to confirm no new findings before merging).
Note: fixing this may turn linters loose on `.github/**` files that have never been linted before in downstream repos — expect the fix PR to also need to clean up whatever those linters newly report.
- 主要语言
- 没有语言数据
- 星标
- 2
- 派生
- 0
- 平均合并
- 53 分钟
- 30 天内合并 PR
- 4
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
automated issue report
难度 1/5 1 小时以内 新手友好度 65/100
lirantal/discoprint#32 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
lawndoc/stack-back#122 ·
-
ai-inspected
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
software-development-practices software-development-practices:nist-ssdf
难度 2/5 1-3 小时 新手友好度 82/100
githubnext/gh-aw-cao#15860 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 68/100
维护者通常 1 天内回复