scripts/markdownlint deletes the tracked package-lock.json and modifies package.json
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bash, nodejs
- 领域
- tooling
调研方向
问题出在 scripts/markdownlint 中检查锁文件并运行 npm install --save-dev 的代码块里。请先阅读该代码块,以及检查 package-json.lock 的那段判断,该名称拼写有误。完成的标准是:在未安装 markdownlint 的情况下运行脚本后,git status 中 package-lock.json 和 package.json 保持不变,并且 lint 仍然正常运行。该 issue 建议用 npm install --no-save 作为修复方案。
由索引模型根据 Issue 内容生成。
描述
Error Report
Please answer the following questions before submitting your issue. Thanks!
-
What is the URL/path of the document related to this issue?
-
How would you like to improve it?
When
markdownlintis not installed globally and./node_modules/.bin/markdownlintdoes not exist yet, running./scripts/markdownlint <files>deletes the trackedpackage-lock.jsonfile and modifiespackage.json:$ ./scripts/markdownlint some-file.md $ git status --short D package-lock.json M package.jsonThe cause is in the following part of the script:
had_lock= if test -f package-json.lock ; then had_lock=true fi npm install --save-dev '[email protected]' if [[ -z "$had_lock" ]] ; then rm -f package-lock.json fi- The lock file check uses
package-json.lockinstead ofpackage-lock.json, sohad_lockis always empty andpackage-lock.jsonis always removed.package-lock.jsonhas been tracked in the repository since #8881, so this removes a tracked file. npm install --save-devadds"markdownlint-cli": "^0.17.0"todevDependenciesinpackage.json, and the script does not revert it.
Because
AGENTS.mdand several skills in.agents/instruct agents to run./scripts/markdownlint <files>for validation, these unrelated changes can easily end up in doc PRs.Suggested fix: install
markdownlint-cliwithout modifying the tracked files, for example, withnpm install --no-save '[email protected]', and remove thehad_locklogic. Alternatively, addmarkdownlint-clitodevDependenciesinpackage.jsonandpackage-lock.json. - The lock file check uses
- 主要语言
- Python
- 星标
- 615
- 派生
- 724
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 531
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingcap/docs 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
相似的 Issue
-
customer-reported question
难度 2/5 1-3 小时 新手友好度 62/100
Azure/azure-sdk-for-python#49548 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
btclib-org/btclib-wallet#409 ·
维护者通常 1 天内回复
-
Phase 2 PSA Capability & Career Profile
难度 2/5 1-3 小时 新手友好度 62/100
bcgov/digital-journeys#2310 ·
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 78/100
fastmachinelearning/hls4ml#1582 ·
维护者通常 3 天内回复
-
Sort models未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复