Skip to content

Commit 38205b8

Browse files
committed
fix: error and warning raised by flake8
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 8e0f557 commit 38205b8

9 files changed

+16
-10
lines changed

cmake/scripts/.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 88

cmake/scripts/ccwrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
shargs = parser.parse_args()
2424

25-
logline = re.compile("^\.* .+$") # a series of dots, a space, a filename
25+
logline = re.compile(r"^\.* .+$") # a series of dots, a space, a filename
2626

2727

2828
proc = subprocess.run(shargs.cmd, capture_output=True, encoding="ascii")

cmake/scripts/cmake_core.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env python3
22

33
import argparse
4-
import sys
54
from pathlib import Path
65
from jinja2 import Environment, FileSystemLoader
7-
from cmake_gen import *
6+
from cmake_gen import config_for_bareflat, render
87

98
script_path = Path(__file__).parent.resolve()
109

cmake/scripts/cmake_easy_setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
print(
4747
"""
4848
Warning: you did not specify which board you were targeting;
49-
please review the generated CMakeLists.txt to remove the placeholder value before calling `cmake`.
49+
please review the generated CMakeLists.txt to remove the placeholder
50+
value before calling `cmake`.
5051
"""
5152
)
5253

cmake/scripts/cmake_libs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import argparse
44
from pathlib import Path
55
from jinja2 import Environment, FileSystemLoader
6-
from cmake_gen import *
6+
from cmake_gen import autoconfig, render
77

88
script_path = Path(__file__).parent.resolve()
99

cmake/scripts/cmake_updater_hook.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python3
22

33
"""
4-
This file centralizes all the operations needed to regenerate the CMakeLists.txt scattered along this repo.
4+
This file centralizes all the operations needed to regenerate the CMakeLists.txt
5+
scattered along this repo.
56
Hint: it would be a good practice to run it before committing...
67
"""
78

cmake/scripts/cmake_variant.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import argparse
44
from pathlib import Path
55
from jinja2 import Environment, FileSystemLoader
6-
from cmake_gen import *
6+
from cmake_gen import config_for_bareflat, render
77

88
script_path = Path(__file__).parent.resolve()
99

cmake/scripts/generate_header.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import argparse
44
import pathlib
5-
import subprocess
65

76
parser = argparse.ArgumentParser()
87
parser.add_argument(

cmake/scripts/parse_boards.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __getattr__(self, attr):
2525
return self.__getitem__(attr)
2626

2727
def __setattr__(self, attr, val):
28-
return self.__setitem__(item, attr)
28+
return self.__setitem__(val, attr)
2929

3030
def set_default_entries(self, mothercfg):
3131
for k, v in mothercfg.items():
@@ -51,9 +51,13 @@ def evaluate_entries(self, wrt=None):
5151
self[k].evaluate_entries(wrt)
5252

5353

54+
def default_reject(x):
55+
return False
56+
57+
5458
def parse_file(infile, reject=None):
5559
if reject is None:
56-
reject = lambda x: False
60+
reject = default_reject
5761

5862
config = Configuration()
5963

0 commit comments

Comments
 (0)