Builds the English-comments check of MIL-013: a reusable workflow that fails a pull request with a non-English comment and tells the author. Tasks 1 to 7 and the documents of task 10.
What this adds
Corpus and method (tasks 1, 2): a labelled corpus (300 English, 45 Danish, 45 Malay, 48 other) and ADR-0012, which compares a rule-based method, langdetect, langid and lingua. langid with a pre-filter, probability 0.6 and three words flags 0 of 300 English comments, 44/45 Danish, 41/45 Malay and 48/48 of the others. The Danish and Malay comments were written by the AI, not collected from real code; the ADR says so.
Extractor and detector (tasks 3, 4):tools/english_comments.py reads comments and docstrings for the languages of ADR-0010 (the scanner of count_loc.py can now return comment text), checks only the lines a branch adds (or every file), has an ignore marker and an allowed-words file. A scan of this repository during the build found two false positives (a JSON docstring, Usage: lines); the pre-filter rules in the ADR came from them.
Report and workflow (tasks 5, 6):tools/english_comments_report.py keeps one comment that mentions the author, updated on a re-run and marked resolved on a pass; english-comments.yml is the reusable workflow. It uses the token of the run unless REPORT_TOKEN is given.
Tests (task 7): 673 tests pass, 98 % coverage of tools/; the corpus rates are tests.
Documents (task 10): guide, README section, wiki in English, Danish and Bahasa Malaysia, changelog entry.
What this does not do
It has not run on the instance: the trial on a throwaway pull request (task 8, comment with the mention, update, resolve, token search) is open. The uses: syntax, gitea.event.pull_request.* contexts and the token's permission to comment are untested.
It does not block anything yet: marking the check as required is the owner's setting (task 9).
This repository does not call the workflow yet, and @v2 does not contain it until release 2.3.0 (tasks 11); the guide says to call @main until then.
The milestone's results and ADR-0012 have no review record yet; ADR-0012 stays Proposed.
Issues
No issue closed: every task here is only partly done until it runs on the instance.
Commits carry Task: MIL-013#N trailers (1 to 6 and 10). Not merged by the author.
Builds the English-comments check of [MIL-013](docs/milestones/mil-013-english-comments-check.md): a reusable workflow that fails a pull request with a non-English comment and tells the author. Tasks 1 to 7 and the documents of task 10.
## What this adds
- **Corpus and method (tasks 1, 2):** a labelled corpus (300 English, 45 Danish, 45 Malay, 48 other) and [ADR-0012](docs/adr/adr-0012-english-comment-detection.md), which compares a rule-based method, `langdetect`, `langid` and `lingua`. `langid` with a pre-filter, probability 0.6 and three words flags 0 of 300 English comments, 44/45 Danish, 41/45 Malay and 48/48 of the others. The Danish and Malay comments were written by the AI, not collected from real code; the ADR says so.
- **Extractor and detector (tasks 3, 4):** `tools/english_comments.py` reads comments and docstrings for the languages of ADR-0010 (the scanner of `count_loc.py` can now return comment text), checks only the lines a branch adds (or every file), has an ignore marker and an allowed-words file. A scan of this repository during the build found two false positives (a JSON docstring, `Usage:` lines); the pre-filter rules in the ADR came from them.
- **Report and workflow (tasks 5, 6):** `tools/english_comments_report.py` keeps one comment that mentions the author, updated on a re-run and marked resolved on a pass; `english-comments.yml` is the reusable workflow. It uses the token of the run unless `REPORT_TOKEN` is given.
- **Tests (task 7):** 673 tests pass, 98 % coverage of `tools/`; the corpus rates are tests.
- **Documents (task 10):** guide, README section, wiki in English, Danish and Bahasa Malaysia, changelog entry.
## What this does not do
- It has **not run on the instance**: the trial on a throwaway pull request (task 8, comment with the mention, update, resolve, token search) is open. The `uses:` syntax, `gitea.event.pull_request.*` contexts and the token's permission to comment are untested.
- It does not block anything yet: marking the check as required is the owner's setting (task 9).
- This repository does not call the workflow yet, and `@v2` does not contain it until release 2.3.0 (tasks 11); the guide says to call `@main` until then.
- The milestone's results and ADR-0012 have no review record yet; ADR-0012 stays `Proposed`.
## Issues
No issue closed: every task here is only partly done until it runs on the instance.
Refs #197
Refs #198
Refs #199
Refs #200
Refs #201
Refs #202
Refs #203
Refs #206
Commits carry `Task: MIL-013#N` trailers (1 to 6 and 10). Not merged by the author.
300 English comments from this repository and 138 comments in Danish, Bahasa
Malaysia, German, Swedish, Norwegian and French, written for the purpose and
not checked by a native reader. The detection method is measured on it.
Refs #197
Task: MIL-013#1
Compares a rule-based method, langdetect, langid and lingua on the corpus.
langid with a pre-filter and a 0.6 threshold flags 0 of 300 English comments,
44/45 Danish and 41/45 Malay. The comparison script is kept next to the corpus.
Refs #198
Task: MIL-013#2
tools/english_comments.py reads the comments and docstrings of the languages of
ADR-0010 (the scanner of count_loc.py now returns the comment text), joins the
lines of a block, removes everything that is not a word and judges the block
with langid (ADR-0012). It checks the lines a branch adds, or every tracked
file, honours an ignore marker and an allowed-words file, and prints each
finding as an annotation. The rates of the corpus are tests.
Refs #199
Refs #200
Refs #203
Task: MIL-013#3
Task: MIL-013#4
tools/english_comments_report.py keeps one comment on the pull request that
mentions the author, updates it on a re-run and marks it resolved when the
check passes. english-comments.yml runs the check on the full history, tells
the author even when the check fails, and then fails the run. A script that no
release holds yet no longer counts as missing from the default tools-ref.
Refs #201
Refs #202
Task: MIL-013#5
Task: MIL-013#6
Adds the guide, the README section with its diagram, the wiki page in English,
Danish and Bahasa Malaysia, the Home and Capabilities rows, the sidebar entry
and the changelog entry under Unreleased.
Refs #206
Task: MIL-013#10
Tirsvad
merged commit eeaf6f5361 into main2026-10-19 06:48:54 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Builds the English-comments check of MIL-013: a reusable workflow that fails a pull request with a non-English comment and tells the author. Tasks 1 to 7 and the documents of task 10.
What this adds
langdetect,langidandlingua.langidwith a pre-filter, probability 0.6 and three words flags 0 of 300 English comments, 44/45 Danish, 41/45 Malay and 48/48 of the others. The Danish and Malay comments were written by the AI, not collected from real code; the ADR says so.tools/english_comments.pyreads comments and docstrings for the languages of ADR-0010 (the scanner ofcount_loc.pycan now return comment text), checks only the lines a branch adds (or every file), has an ignore marker and an allowed-words file. A scan of this repository during the build found two false positives (a JSON docstring,Usage:lines); the pre-filter rules in the ADR came from them.tools/english_comments_report.pykeeps one comment that mentions the author, updated on a re-run and marked resolved on a pass;english-comments.ymlis the reusable workflow. It uses the token of the run unlessREPORT_TOKENis given.tools/; the corpus rates are tests.What this does not do
uses:syntax,gitea.event.pull_request.*contexts and the token's permission to comment are untested.@v2does not contain it until release 2.3.0 (tasks 11); the guide says to call@mainuntil then.Proposed.Issues
No issue closed: every task here is only partly done until it runs on the instance.
Refs #197
Refs #198
Refs #199
Refs #200
Refs #201
Refs #202
Refs #203
Refs #206
Commits carry
Task: MIL-013#Ntrailers (1 to 6 and 10). Not merged by the author.