Switch from test to lint job for checking fluent files
Categories
(Core :: Internationalization: Localization, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: flod, Assigned: dminor)
References
(Blocks 3 open bugs)
Details
Attachments
(2 files)
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 5•7 years ago
|
||
Comment 6•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 7•5 years ago
|
||
I see Fluent in the check file. Is this fixed now?
Reporter | ||
Comment 8•5 years ago
|
||
No. This is still a test, not a lint job. The fact that it uses Fluent was fixed by bug 1517496.
And, to be clear, I'm not the right person to decide if this should be closed as WONTFIX or kept open.
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Comment 9•4 years ago
|
||
Additional note: the current solution doesn't seem to catch all strings (see the one in unknownContentType.ftl)
https://phabricator.services.mozilla.com/D100082
Reporter | ||
Comment 10•4 years ago
|
||
(I also doubt this bug is still assigned at this point)
Updated•4 years ago
|
Comment 11•4 years ago
|
||
I'd probably be a good candidate to work on this once we prioritize it, as I have some experience working with the linting system.
Assignee | ||
Comment 12•4 years ago
|
||
I'm also interested in working on this :)
Some things that flod had to flag manually when reviewing Bug 1510797 that we might be able to lint:
- Namespacing, e.g. common prefix for all messages in a single fluent file.
- Whitespace around '##' and '###' block comments.
- Presence and format of comments for variables used in a message.
- Misuse of message references for recurrent text.
Reporter | ||
Comment 13•4 years ago
|
||
Namespacing might be challenging: old files don't use, some files already have very specific IDs without using a common namespace.
Same for message references: some are OK, so it would be really hard to avoid having too many errors.
We should enforce lowercase and - on IDs, but we also need to maintain a list of excecptions (per message, or entire files).
Assignee | ||
Comment 14•4 years ago
|
||
Greg and I are planning to work together on this.
Assignee | ||
Comment 15•4 years ago
|
||
I have an initial version of this working. It includes the string checks from the existing test along with an identifier check. It is possible to disable the identifier check on a file by file basis. Try run here: https://treeherder.mozilla.org/jobs?repo=try&selectedTaskRun=efrKIlHsT1miymEW8D6xcQ.0&revision=6c408b4a9424aea68b63771a68e9160ccecb7c7f.
Since Greg doesn't have time to get started on this right away, our plan was to get the initial version of this landed and then file follow on bugs to track adding more sophisticated checks.
Assignee | ||
Comment 16•4 years ago
|
||
This adds a linter for Fluent files based upon the existing test for bad
strings in browser_misused_characters_in_strings.js. It also adds a check
for identifiers that only permits lowercase letters, numbers and the
hyphen character (in ascii). Since a large number of existing identifiers
use uppercase letters, an exclusions file is used to disable the identifier
check on a file by file basis.
Assignee | ||
Comment 17•4 years ago
|
||
Assignee | ||
Comment 18•4 years ago
|
||
Depends on D104414
Comment 19•4 years ago
|
||
Comment 20•4 years ago
|
||
Comment 21•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3a30710b35e8
https://hg.mozilla.org/mozilla-central/rev/b0085234bc44
Description
•