mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-22 23:48:58 +00:00
Allow -fix-errors to fix linter errors
This commit is contained in:
parent
671a4e60aa
commit
7dcedfc56c
@ -1,9 +1,12 @@
|
||||
import os
|
||||
from glob import glob
|
||||
import sys
|
||||
|
||||
import pqclean
|
||||
import helpers
|
||||
|
||||
additional_flags = []
|
||||
|
||||
|
||||
def test_clang_tidy():
|
||||
for scheme in pqclean.Scheme.all_schemes():
|
||||
@ -18,8 +21,9 @@ def check_tidy(implementation: pqclean.Implementation):
|
||||
common_files = glob(os.path.join('..', 'common', '*.c'))
|
||||
helpers.run_subprocess(['clang-tidy',
|
||||
'-quiet',
|
||||
'-header-filter=.*',
|
||||
*cfiles,
|
||||
'-header-filter=.*'] +
|
||||
additional_flags +
|
||||
[*cfiles,
|
||||
*common_files,
|
||||
'--',
|
||||
'-iquote', os.path.join('..', 'common'),
|
||||
@ -28,6 +32,10 @@ def check_tidy(implementation: pqclean.Implementation):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# allow a user to specify --fix-errors, to immediately fix errors
|
||||
if len(sys.argv) >= 2 and sys.argv[1] == '-fix-errors':
|
||||
additional_flags = ['-fix-errors']
|
||||
sys.argv = sys.argv[0:1] + sys.argv[2:]
|
||||
try:
|
||||
import nose2
|
||||
nose2.main()
|
||||
|
Loading…
Reference in New Issue
Block a user