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?
$ find . -type f -exec grep -Il . {} + | rev | cut -d. -f1 | rev | sort | uniq -c | sort -nr
1266 json
721 cpp
704 h
461 d
344 py
275 cmake
228 md
162 ts
145 make
89 cc
73 txt
49 sh
43 mk
32 patch
32 hex
28 c
27 in
26 internal
20 svg
19 ui
16 yml
14 sample
14 gitignore
13 marks
11 m4
10 capnp
9 sage
8 xml
8 1
6 rc
6 ninja
6 include
6 fish
6 bash
5 xpm
4 yaml
4 log
4 ini
4 check_cache
4 bt
3 x
3 toml
3 rs
3 mm
3 lock
3 csv
3 conf
3 clang-format
3 TAG
2 sub
2 s
2 qrc
2 html
2 guess
2 gitattributes
2 clang-tidy
2 am
2 ac
2 Dockerfile
...
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.