aboutsummaryrefslogtreecommitdiffstats
path: root/executor/style_test.go
Commit message (Collapse)AuthorAgeFilesLines
* executor: warn about C89-style var declarationsDmitry Vyukov2020-08-141-5/+48
| | | | | | | | | | | | | | | | | We generally use the newer C99 var declarations combined with initialization because: - declarations are more local, reduced scope - fewer lines of code - less potential for using uninit vars and other bugs However, we have some relic code from times when we did not understand if we need to stick with C89 or not. Also some external contributions that don't follow style around. Add a static check for C89-style declarations and fix existing precedents. Akaros toolchain uses -std=gnu89 (or something) and does not allow variable declarations inside of for init statement. And we can't switch it to -std=c99 because Akaros headers are C89 themselves. So in common.h we need to declare loop counters outside of for.
* executor: fix style checking testDmitry Vyukov2020-08-131-3/+3
| | | | | The regexp for empty suppressions matches _everything_... Don't match suppression if it's empty.
* executor: add some code style checksDmitry Vyukov2020-08-061-0/+107
Move the test from pkg/csource to executor/ in order to be able to (1) run it on *.cc files, (2) run on unprocessed *.h files, (3) produce line numbers. Add a check for missed space after //.