File-scope linter checks consistency between file content and a file path of each file, without comparing with others.
'File-scope' is a sort of namespace that derives from a file path.
For example a file-scope of models/user.en.yml
is en.models.user
.
models/user.en.yml | |
---|---|
✅ |
en:
models:
user:
... |
Starts with |
models/user.en.yml | |
---|---|
👎 |
ja:
models:
user:
... |
Starts with |
controllers/admin/accounts_controller.en.yml | |
---|---|
👎 |
en:
controllers:
nimda:
accounts_controller:
... |
Starts with |
models/user.en.yml | |
---|---|
👎 |
en:
models:
user:
...
foo: ... |
|
models/user.en.yml | |
---|---|
👎 |
en:
models:
user: 'User' |
|
Symmetry linter compares a pair of files and checks their symmetry. As a pair, one is 'master' and another is 'foreign'.
If your primary language is English and going to support Japanese as secondary, you may want to lint Japanese (foreign) locale file based on English locale file (master).
→ Justify violations with !only
or ignore with !ignore:key
master | foreign | |
---|---|---|
✅ |
en:
title: 'Non zero sum'
desc: 'A situation in...' |
ja:
title: '非ゼロ和'
desc: '複数の人が相互...' |
Every keys exist on both files. No asymmetric keys |
master | foreign | |
---|---|---|
👎 |
en:
title: 'Non zero sum'
desc: 'A situation in...' |
ja:
title: '非ゼロ和'
|
Missing |
master | foreign | |
---|---|---|
👎 |
en:
title: 'Non zero sum'
|
ja:
title: '非ゼロ和'
desc: '複数の人が相互...' |
Having the extra |
→ Ignore violations with !ignore:key
master | foreign | |
---|---|---|
👎 |
en:
follower_count:
one: '1 follower'
other: '%{count} followers' |
ja:
follower_count: '%{count} フォロワ'
|
|
→ Ignore violations with !ignore:args
master | foreign | |
---|---|---|
✅ |
en:
key: '%{alpha} %{beta} %{beta}' |
ja:
key: '%{beta} %{alpha}' |
It's insensitive of arguments order and repetition |
master | foreign | |
---|---|---|
👎 |
en:
key: '%{alpha}' |
ja:
key: 'alpha' |
No arguments exists in |
master | foreign | |
---|---|---|
👎 |
en:
key: '%{alpha}' |
ja:
key: '%{gamma}' |
A set of arguments is different from master |