Skip to content

Commit 028c129

Browse files
committed
scripts: move the ruff linter command into a script
This makes it easier for users to run it with the correct options locally. Also, update the ruff, pytype and cmakelint versions to the latest current ones. Closes curl#17343
1 parent 828f998 commit 028c129

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

.github/workflows/checksrc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
python3-toml python3-markupsafe python3-jinja2 python3-tabulate \
6464
python3-typing-extensions python3-libcst python3-impacket \
6565
python3-websockets python3-pytest
66-
python3 -m pip install --break-system-packages cmakelint==1.4.3 pytype==2024.9.13 ruff==0.6.8
66+
python3 -m pip install --break-system-packages cmakelint==1.4.3 pytype==2024.10.11 ruff==0.11.9
6767
6868
- name: spellcheck
6969
run: |
@@ -81,7 +81,7 @@ jobs:
8181
run: find . -name '*.py' -exec pytype -j auto -k {} +
8282

8383
- name: ruff
84-
run: ruff check --extend-select=B007,B016,C405,C416,COM818,D200,D213,D204,D401,D415,FURB129,N818,PERF401,PERF403,PIE790,PIE808,PLW0127,Q004,RUF010,SIM101,SIM117,SIM118,TRY400,TRY401
84+
run: scripts/pythonlint.sh
8585

8686
reuse:
8787
runs-on: ubuntu-latest

scripts/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
EXTRA_DIST = coverage.sh completion.pl firefox-db2pem.sh checksrc.pl \
2626
mk-ca-bundle.pl mk-unity.pl schemetable.c cd2nroff nroff2cd cdall cd2cd managen \
2727
dmaketgz maketgz release-tools.sh verify-release cmakelint.sh mdlinkcheck \
28-
CMakeLists.txt randdisable wcurl
28+
CMakeLists.txt pythonlint.sh randdisable wcurl
2929

3030
dist_bin_SCRIPTS = wcurl
3131

scripts/pythonlint.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
#***************************************************************************
3+
# _ _ ____ _
4+
# Project ___| | | | _ \| |
5+
# / __| | | | |_) | |
6+
# | (__| |_| | _ <| |___
7+
# \___|\___/|_| \_\_____|
8+
#
9+
# Copyright (C) Dan Fandrich, <[email protected]>, et al.
10+
#
11+
# This software is licensed as described in the file COPYING, which
12+
# you should have received as part of this distribution. The terms
13+
# are also available at https://curl.se/docs/copyright.html.
14+
#
15+
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16+
# copies of the Software, and permit persons to whom the Software is
17+
# furnished to do so, under the terms of the COPYING file.
18+
#
19+
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20+
# KIND, either express or implied.
21+
#
22+
# SPDX-License-Identifier: curl
23+
#
24+
###########################################################################
25+
26+
# Use ruff to perform a style analysis on all Python code in the supplied
27+
# locations, or all Python files found in the current directory tree by
28+
# default.
29+
30+
ruff check --extend-select=B007,B016,C405,C416,COM818,D200,D213,D204,D401,D415,FURB129,N818,PERF401,PERF403,PIE790,PIE808,PLW0127,Q004,RUF010,SIM101,SIM117,SIM118,TRY400,TRY401 "$@"

0 commit comments

Comments
 (0)