Commit Graph

6 Commits

Author SHA1 Message Date
Matthias Grob 2716ce7a56 pre-commit hook: clear output with error, file name, diff, instructions 2021-10-21 19:07:13 -04:00
Matthias Grob 4454fe9770 pre-commit hook: don't unstage the entire file containing a style issue 2021-10-21 19:07:13 -04:00
Lorenz Meier 2e7221cd22 Style check commit hook: Ensure that formatted files need to be re-added. 2019-12-24 15:16:26 +01:00
Matthias Grob 2c56ceec93 astyle: switch condition to empty string check
Thanks to @bkueang 's review comment I switched to an explicit check for
an empty sting instead of a condition that could be theoretically true
in other cases and is less readable.

Type "man test" on your terminal to read up what -n stands for.
2018-05-09 07:54:22 +02:00
Matthias Grob 72db7d3396 astyle: fix display language dependency
The shell script which checks the style relies on greping for the
keyword "Formatted" in the output of astyle. But the program has
localization support and will output in other languages e.g. german.
This leads to all style checks always succeeding. I only tested this
on Windows in Cygwin but I can imagine the problem also exists in
non-english Ubuntu installations.

Solution is the parameter --formatted of astyle which only produces
any output if there was something to fix. This allows for a display
language independent condition for an empty string inside the shell
script.
2018-05-09 07:54:22 +02:00
Daniel Agar 9f15c572a3 astyle scripting move to Tools/astyle 2017-08-23 08:07:36 +02:00