Repository navigation
Closed
Labels
Description
Looks like pre-commit skips non-English directories. Please take a look at those:
A relevant bit from the full Travis build output:
$ pre-commit run --all-files
[…]
Trim Trailing Whitespace.................................................Failed
hookid: trailing-whitespace
Files were modified by this hook. Additional output:
Fixing public/episode/2017/04-14-096/index.html
Fixing public/episode/2016/03-31-050/index.html
[…]
Fixing public/episode/2016/09-01-072/index.html
Fixing public/episode/2015/12-29-036/index.html
The command "pre-commit run --all-files" exited with 1.
$ git status
HEAD detached at df0529b
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: "public/categories/\320\263\320\276\321\201\321\202\320\270/index.html"
modified: "public/categories/\320\263\320\276\321\201\321\202\320\270/index.xml"
modified: "public/categories/\320\270\320\275\321\202\320\265\321\200\320\262\321\214\321\216/index.html"
modified: "public/categories/\320\270\320\275\321\202\320\265\321\200\320\262\321\214\321\216/index.xml"
modified: "public/categories/\320\270\321\202\320\276\320\263\320\270/index.html"
modified: "public/categories/\320\270\321\202\320\276\320\263\320\270/index.xml"
modified: "public/categories/\320\272\320\260\320\274\320\270\320\275/index.html"
modified: "public/categories/\320\272\320\260\320\274\320\270\320\275/index.xml"
modified: "public/categories/\320\275\320\276\320\262\320\276\321\201\321\202\320\270/index.html"
modified: "public/categories/\320\275\320\276\320\262\320\276\321\201\321\202\320\270/index.xml"
modified: public/js/highlight.pack.js
modified: public/page/1/index.html
no changes added to commit (use "git add" and/or "git commit -a")
Those directories in public/categories/ are гости, итоги, камин, новости, and интервью.
Reacted by Elena Grahovac and anthony sottile
Activity
asottile commentedon Sep 5, 2017
Thanks for the report! I should be able to reproduce and fix this pretty easily, let me see if there's a workaround to get you going quicker first :)
asottile commentedon Sep 5, 2017
Ah definitely a bug! It has to do with our usage of
git ls-filesand should be easy to fix.A workaround is to bypass the bug in
--all-files(though not pretty):git ls-files -z | xargs -0 pre-commit run --filesI'll get a fix out for you asap!
asottile commentedon Sep 5, 2017
This is fixed in 0.18.2, I'll see what I need to poke to get this into brew :)
asottile commentedon Sep 5, 2017
womp, I don't have access to macos, I think this is the minimum necessary to get this version into brew:
(remove
--dry-runif it looks correct)AlekSi commentedon Sep 6, 2017
I installed 0.18.2 (it was merged) and that's what I got:
asottile commentedon Sep 6, 2017
Ah yes the fun python2 "bug"
When printing to a non-tty, python2
print()must have ascii-convertible arguments.A workaround would be to use
language_version: python3, or I could adjustpre-commit-hooksto not useprint()and instead write bytes to stdoutasottile commentedon Sep 6, 2017
I've submitted a patch to homebrew that should prefer python3:
Homebrew/homebrew-core#17712
Merge pull request pre-commit#603 from scop/check_shebang_scripts_are…