521@@ -512,6 +522,44 @@ sourced files to the exclude list.
522 }
523 }
524
525+fn lint_trailing_newline() -> LintResult {
526+ let files = check_output(
527+ git()
528+ .args([
529+ "ls-files", "--", "*.py", "*.cpp", "*.h", "*.md", "*.rs", "*.sh", "*.cmake",
Should we add any other ones here?
0$ find . -type f -exec grep -Il . {} + | rev | cut -d. -f1 | rev | sort | uniq -c | sort -nr
11266 json
2 721 cpp
3 704 h
4 461 d
5 344 py
6 275 cmake
7 228 md
8 162 ts
9 145 make
10 89 cc
11 73 txt
12 49 sh
13 43 mk
14 32 patch
15 32 hex
16 28 c
17 27 in
18 26 internal
19 20 svg
20 19 ui
21 16 yml
22 14 sample
23 14 gitignore
24 13 marks
25 11 m4
26 10 capnp
27 9 sage
28 8 xml
29 8 1
30 6 rc
31 6 ninja
32 6 include
33 6 fish
34 6 bash
35 5 xpm
36 4 yaml
37 4 log
38 4 ini
39 4 check_cache
40 4 bt
41 3 x
42 3 toml
43 3 rs
44 3 mm
45 3 lock
46 3 csv
47 3 conf
48 3 clang-format
49 3 TAG
50 2 sub
51 2 s
52 2 qrc
53 2 html
54 2 guess
55 2 gitattributes
56 2 clang-tidy
57 2 am
58 2 ac
59 2 Dockerfile
60 ...
You should only be counting files tracked by git: git ls-files | sed -n 's/.*\.//p' | sort | uniq -c | sort -rn
Happy to add any, if you see one and a reason to add it and no reason against adding it.
Did a git clean -fxd before running it so I think it should’ve covered only the tracked files.
Will let you decide of course which ones makes sense to include, just pointing out that we may want to extend this list.