主题: tooling
-
用决策模型选择工具或技能:Choice 负责排序,Noul 允许弃选
为什么针对候选工具的 Choice 回答的是相对问题(哪个候选最合适),而每个候选的 Noul 回答的是绝对问题(这一轮究竟是否需要工具);以及 TypeSafe 的技能建议指南如何在包含 182 个技能的目录上结合两者:一次请求为全部候选排序,第二次读取前三名,并可拒绝全部候选。
-
本地数据库的种子数据与固定数据集:小规模、幂等,并与模式一同版本化
区分所有环境都需要的参考数据、开发和演示用的示例数据,以及由测试创建的测试数据。将种子脚本写成基于自然键执行 upsert 的幂等代码,保持示例集小而有名,在安装脚本和 CI 中都于迁移后运行,绝不直接用未经处理的生产数据填充开发机。
-
设计持续集成流水线
CI 流水线应快速、能够自我测试,并对每项变更采用同一流程:从干净检出的代码构建,分阶段运行静态检查和测试,明确暴露失败,并让总耗时足够短,使人愿意等待结果。
-
Keeping CI and local checks identical: one entry point, pinned tools, same container
A check that passes locally should pass in CI and vice versa: define every check once as a named task, pin the toolchain in a committed manifest that both the bootstrap and the pipeline install from, run CI in the same container image as the dev environment, fix locale and timezone, and treat any CI-only failure as a parity bug to eliminate before fixing the symptom.
-
将自动格式化和代码检查作为团队约定
把布局交给格式化工具,把机械检查交给代码检查器,可以消除评审中的风格争论;EditorConfig、PEP 8 以及 Ruff 等工具展示了如何将约定编码到仓库中。
-
Konfigurationsformate wählen: JSON, YAML oder TOML
JSON (RFC 8259) ist streng und überall lesbar, kennt aber keine Kommentare; YAML ist gut lesbar, doch unzitierte Werte werden nach Muster typisiert; TOML ist für Konfiguration entworfen, mit Kommentaren, expliziten Typen und Tabellen. Wer die Datei bearbeitet und was sie liest, entscheidet – und jedes Format braucht nach dem Parsen eine Prüfung gegen ein Schema.
-
Checking whether a task wrapper hid the failure of its inner command
Determine whether a reported successful task actually propagated the outcome of the compiler, test runner, or migration command on which success depends.
-
会自我验证的首日设置脚本:bootstrap、doctor 与冒烟测试
克隆后的一条命令,要么生成可用环境,要么给出缺少什么以及如何修复的精确清单:只读 doctor 脚本检查每项要求,幂等 bootstrap 仅安装检查报告缺少的部分,冒烟测试决定退出状态;CI 从干净机器运行它,避免脚本在新人之间的空档期失效。
-
使用类型提示逐步为 Python 引入类型检查
类型提示(PEP 484)是可选注解,由 mypy 等外部工具检查;逐步将其加入代码库,能够发现接口使用错误并记录设计意图,而不改变运行时行为。
-
Choosing a configuration format: JSON, YAML or TOML
JSON is strict and universal but has no comments; YAML is readable but has surprising implicit typing; TOML is explicit and comment-friendly for flat-to-moderate structures. Pick by who edits the file and what parses it.
-
EditorConfig and committed editor settings: the small conventions that stop whitespace diffs
A .editorconfig file fixes indentation, line endings, charset and final newlines per file type across editors, before any formatter runs; editor workspace settings committed next to it should encode project decisions such as format-on-save, not personal preferences.
-
Virtual environments: one interpreter state per project
A virtual environment is a private site-packages tied to an interpreter; creating one per project prevents version conflicts and makes the dependency set reproducible and disposable.
-
开发容器:用 devcontainer.json 定义可复现的开发环境
devcontainer.json 描述编辑器、云工作区或 CI 执行器应为仓库构建的容器,包括镜像或 Dockerfile、features、转发端口、生命周期命令和编辑器定制。containers.dev 的开放规范让同一文件可用于本地、托管工作区和流水线,使工具链随代码固定,而不是分别存在于各台主机上。
-
Which pre-commit hooks survive a year in a team repository, and which get removed or routinely bypassed?
Open question: Git's pre-commit hook can be bypassed with --no-verify, so a local hook only helps while contributors keep it; which hook types (formatters, linters, secret scanners, test subsets) have stayed in use for a year or more in team repositories, which were removed or moved to CI, and how often were they bypassed?
-
Git hooks for fast local checks
Client-side hooks such as pre-commit run formatters and quick linters before a commit exists; they save review time but must stay fast, must not be the only gate, and are not versioned by Git itself.
-
Task runners beyond make: just, npm scripts and Invoke for project commands
A task runner gives a project one place for its commands so that people, agents and CI invoke the same names; just stores recipes in a justfile with make-like syntax and no timestamp logic, npm scripts live in package.json with pre and post hooks, and Invoke turns @task functions in a tasks.py into a command line. Pick the one that needs no extra toolchain, keep recipes short, and let CI call them.
机器可读: JSON