Skip to content

Commit d468690

Browse files
committed
workflow: fix(pylint): Fix lint path
1 parent 7888cc4 commit d468690

File tree

12 files changed

+35
-20
lines changed

12 files changed

+35
-20
lines changed

.github/workflows/check.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ jobs:
3636
run: |
3737
apt update && apt install pylint -y
3838
rm mkdtboimg.py
39-
pylint $(find | grep .py )
39+
mv .pylintrc a
40+
A=$(find | grep .py )
41+
mv a .pylintrc
42+
pylint $A

.pylintrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ py-version = 3.10
44

55
# Disable some style warnings that don't affect functionality
66
disable =
7-
C0114, # missing-module-docstring
8-
C0115, # missing-class-docstring
9-
C0116, # missing-function-docstring
107
C0301, # line-too-long
118
R0912, # too-many-branches
129
R0914, # too-many-locals

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@ runs:
456456
457457
if [ "${{ inputs.lxc }}" == "true" ]; then
458458
echo "::group::Enabling LXC"
459-
python3 ${{ github.action_path }}/nethunter/config.py "$CONFIG_FILE" -w
459+
python3 ${{ github.action_path }}/lxc/config.py "$CONFIG_FILE" -w
460460
if [ "${{ inputs.lxc-patch }}" == "true" ]; then
461-
python3 "${{ github.action_path }}/lxc/patch.py"
461+
python3 "${{ github.action_path }}/lxc/patch_cocci.py"
462462
fi
463463
echo "::endgroup::"
464464
fi
@@ -656,7 +656,7 @@ runs:
656656
657657
echo "::group:: Cleaning up"
658658
python3 ${{ github.action_path }}/clean.py
659-
python3 ${{ github.action_path }}/clean.py --ccache
659+
python3 ${{ github.action_path }}/clean.py --env
660660
echo "::endgroup::"
661661
662662
- id: uploadi

clean.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def clean_env_vars() -> None:
9292
]
9393
for var in env_vars:
9494
if var in os.environ:
95-
print(f"unset {var}")
95+
os.system("unset {var}")
9696

9797

9898
def clean_temp_files() -> None:
@@ -124,6 +124,7 @@ def clean_all(kernel_dir: str = "kernel", build_dir: str = "build") -> None:
124124

125125

126126
def main() -> None:
127+
"""Main entry point for the cleanup script."""
127128
parser = argparse.ArgumentParser(
128129
description="Clean up build artifacts and temporary files"
129130
)

kernelsu/apply_cocci.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,8 @@ def extract_files_from_cocci(cocci_file: str) -> list[str]:
2929
content = Path(cocci_file).read_text(encoding='utf-8')
3030
# Match pattern: file in "path/to/file.c"
3131
matches = re.findall(r'file in "([^"]+)"', content)
32-
# Remove duplicates while preserving order
33-
seen = set()
34-
unique_files = []
35-
for f in matches:
36-
if f not in seen:
37-
seen.add(f)
38-
unique_files.append(f)
39-
return unique_files
32+
# Remove duplicates while preserving order (Python 3.7+ dict preserves insertion order)
33+
return list(dict.fromkeys(matches))
4034

4135

4236
def apply_spatch(cocci_file: str, target_file: str) -> None:
@@ -62,6 +56,7 @@ def apply_spatch(cocci_file: str, target_file: str) -> None:
6256

6357

6458
def main() -> None:
59+
"""Main entry point for applying KernelSU Coccinelle patches."""
6560
sp_file = "minimal.cocci"
6661
# sp_file = "classic.cocci"
6762

lxc/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
CONFIG_NET_CLS_CGROUP
8484
CONFIG_CGROUP_NET_PRIO
8585
CONFIG_FAIR_GROUP_SCHED
86-
CONFIG_!SCHED_WALT
8786
CONFIG_RT_GROUP_SCHED
8887
CONFIG_IP_NF_TARGET_REDIRECT
8988
CONFIG_IP_VS_NFCT
@@ -141,20 +140,24 @@
141140

142141
CONFIGS_OFF = """
143142
CONFIG_ANDROID_PARANOID_NETWORK
143+
CONFIG_SCHED_WALT
144144
"""
145145

146146
CONFIGS_EQ = ""
147147

148148

149149
def color_red(text: str) -> str:
150+
"""Return text wrapped in red ANSI color codes."""
150151
return f"\033[31m{text}\033[0m"
151152

152153

153154
def color_green(text: str) -> str:
155+
"""Return text wrapped in green ANSI color codes."""
154156
return f"\033[32m{text}\033[0m"
155157

156158

157159
def color_white(text: str) -> str:
160+
"""Return text wrapped in white ANSI color codes."""
158161
return f"\033[37m{text}\033[0m"
159162

160163

@@ -218,6 +221,7 @@ def get_config_value(config_file: Path, config: str) -> str | None:
218221

219222

220223
def main() -> None:
224+
"""Main entry point for checking and configuring LXC/Docker kernel options."""
221225
parser = argparse.ArgumentParser(description='Check and configure kernel for LXC/Docker')
222226
parser.add_argument('config_file', help='Path to kernel config file')
223227
parser.add_argument('-w', action='store_true', help='Write changes to config file')

lxc/patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def apply_netfilter_patch() -> None:
143143

144144

145145
def main() -> None:
146+
"""Main function"""
146147
cgroup = find_cgroup_file()
147148

148149
patch_files = [

lxc/patch_cocci.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def apply_patch(patch_file: Path, target_file: Path, kernel_src: Path) -> None:
109109

110110

111111
def main() -> None:
112+
"""Main fcuntion."""
112113
kernel_src = Path.cwd()
113114

114115
# Check dependencies

mkdtboimg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
from __future__ import print_function
16+
"""Tool for packing multiple DTB/DTBO files into a single image."""
1717

18-
"""Tool for packing multiple DTB/DTBO files into a single image"""
18+
from __future__ import print_function
1919

2020
import argparse
2121
import fnmatch

nethunter/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
CONFIG_DVB_SI2168
7979
CONFIG_DVB_ZD1301_DEMOD
8080
81-
CONFIG_MEDIA_TUNER_R820T
8281
CONFIG_HIDRAW
8382
CONFIG_USB_HID
8483
CONFIG_HID_PID
@@ -304,14 +303,17 @@
304303

305304

306305
def color_red(text: str) -> str:
306+
"""Return text wrapped in red ANSI color codes."""
307307
return f"\033[31m{text}\033[0m"
308308

309309

310310
def color_green(text: str) -> str:
311+
"""Return text wrapped in green ANSI color codes."""
311312
return f"\033[32m{text}\033[0m"
312313

313314

314315
def color_white(text: str) -> str:
316+
"""Return text wrapped in white ANSI color codes."""
315317
return f"\033[37m{text}\033[0m"
316318

317319

@@ -374,6 +376,7 @@ def get_config_value(config_file: Path, config: str) -> str | None:
374376

375377

376378
def main() -> None:
379+
"""Main entry point for checking and configuring NetHunter kernel options."""
377380
parser = argparse.ArgumentParser(description='Check and configure kernel for Kali NetHunter')
378381
parser.add_argument('config_file', help='Path to kernel config file')
379382
parser.add_argument('-w', action='store_true', help='Write changes to config file')

0 commit comments

Comments
 (0)