Skip to content

Commit 6aedd5b

Browse files
Restore pylint
1 parent 2974b9a commit 6aedd5b

File tree

8 files changed

+135
-7
lines changed

8 files changed

+135
-7
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ __pycache__/
77
.venv/
88
.scannerwork/
99
.ruff_cache/
10+
.devcontainer/

.github/workflows/python-app.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ jobs:
2929
run: |
3030
python -m pip install uv
3131
if [ -f requirements.txt ]; then uv pip install -r requirements.txt --system; fi
32-
- name: Lint with ruff
32+
- name: Lint with ruff and pylint
3333
run: |
3434
ruff check packet
35+
pylint packet/routes packet
3536
3637
typecheck:
3738
runs-on: ubuntu-latest

.pylintrc

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
[MASTER]
2+
ignore = ,input
3+
persistent = yes
4+
load-plugins = pylint_quotes
5+
6+
[MESSAGES CONTROL]
7+
disable =
8+
missing-docstring,
9+
fixme,
10+
duplicate-code,
11+
no-member,
12+
parse-error,
13+
bad-continuation,
14+
too-few-public-methods,
15+
global-statement,
16+
cyclic-import,
17+
locally-disabled,
18+
file-ignored,
19+
no-else-return,
20+
unnecessary-lambda
21+
22+
[REPORTS]
23+
output-format = text
24+
files-output = no
25+
reports = no
26+
27+
[FORMAT]
28+
max-line-length = 120
29+
max-statement-lines = 75
30+
single-line-if-stmt = no
31+
no-space-check = trailing-comma,dict-separator
32+
max-module-lines = 1000
33+
indent-string = ' '
34+
string-quote=single-avoid-escape
35+
triple-quote=single
36+
docstring-quote=double
37+
38+
[MISCELLANEOUS]
39+
notes = FIXME,XXX,TODO
40+
41+
[SIMILARITIES]
42+
min-similarity-lines = 4
43+
ignore-comments = yes
44+
ignore-docstrings = yes
45+
ignore-imports = no
46+
47+
[BASIC]
48+
# Regular expression which should only match correct module names
49+
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
50+
51+
# Regular expression which should only match correct module level names
52+
const-rgx=(([A-Za-z_][A-Za-z1-9_]*)|(__.*__))$
53+
54+
# Regular expression which should only match correct class names
55+
class-rgx=[A-Z_][a-zA-Z0-9_]+$
56+
57+
# Regular expression which should only match correct function names
58+
function-rgx=[a-z_][a-z0-9_]{2,35}$
59+
60+
# Regular expression which should only match correct method names
61+
method-rgx=[a-z_][a-z0-9_]{2,30}$
62+
63+
# Regular expression which should only match correct instance attribute names
64+
attr-rgx=[a-z_][a-z0-9_]{2,30}$
65+
66+
# Regular expression which should only match correct argument names
67+
argument-rgx=[a-z_][a-z0-9_]{0,30}$
68+
69+
# Regular expression which should only match correct variable names
70+
variable-rgx=[a-z_][a-z0-9_]{0,30}$
71+
72+
# Regular expression which should only match correct list comprehension /
73+
# generator expression variable names
74+
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
75+
76+
# Good variable names which should always be accepted, separated by a comma
77+
good-names=logger,id,ID
78+
79+
# Bad variable names which should always be refused, separated by a comma
80+
bad-names=foo,bar,baz,toto,tutu,tata
81+
82+
# List of builtins function names that should not be used, separated by a comma
83+
bad-functions=apply,input
84+
85+
[DESIGN]
86+
max-args = 10
87+
ignored-argument-names = _.*
88+
max-locals = 20
89+
max-returns = 6
90+
max-branches = 15
91+
max-statements = 55
92+
max-parents = 7
93+
max-attributes = 10
94+
min-public-methods = 2
95+
max-public-methods = 20
96+
97+
[EXCEPTIONS]
98+
overgeneral-exceptions = builtins.Exception

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,13 @@ All DB commands are from the `Flask-Migrate` library and are used to configure D
133133
docs [here](https://flask-migrate.readthedocs.io/en/latest/) for details.
134134

135135
## Code standards
136-
This project is configured to use ruff and mypy. Commits will be ruffed and typechecked by GitHub actions and if the
136+
This project is configured to use ruff, pylint, and mypy. Commits will be ruffed, pylinted, and typechecked by GitHub actions and if the
137137
score drops your build will fail blocking you from merging. To make your life easier just run it before making a PR.
138138

139-
To run ruff and mypy use these commands:
139+
To run ruff, pylint, and mypy use these commands:
140140
```bash
141141
ruff check packet
142+
pylint packet/routes packet
142143
mypy --disable-error-code import --disable-error-code name-defined --disallow-untyped-defs --exclude routes packet
143144
```
144145

gulpfile.js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ requireDir('./tasks', {recurse: true});
2020
// Default task
2121
gulp.task('default', gulp.parallel('css', 'js'));
2222
gulp.task('production', gulp.parallel('css', 'js', 'generate-favicon'));
23-
gulp.task('lint', gulp.parallel('ruff'));
23+
gulp.task('lint', gulp.parallel('ruff', 'pylint'));

gulpfile.js/tasks/pylint.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const gulp = require('gulp');
2+
const exec = require('child_process').exec;
3+
4+
let pylintTask = (cb) => {
5+
exec('pylint --load-plugins pylint_quotes packet/routes packet', function (err, stdout, stderr) {
6+
console.log(stdout);
7+
console.log(stderr);
8+
cb(err);
9+
});
10+
};
11+
12+
gulp.task('pylint', pylintTask);

requirements.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ Flask-Mail==0.10.0
33
Flask-Migrate~=2.7.0
44
Flask-pyoidc~=3.7.0
55
Flask~=1.1.4
6-
csh-ldap @ git+https://github.com/costowell/csh_ldap.git@v2.5.0
6+
csh-ldap @ git+https://github.com/ComputerScienceHouse/csh_ldap.git@2.5.0
77
ddtrace==3.12.2
88
flask_sqlalchemy~=2.5.1
99
gunicorn~=20.0.4
1010
mypy==1.17.1
1111
onesignal-sdk~=1.0.0
1212
psycopg2-binary~=2.9.3
1313
ruff==0.12.11
14+
pylint==3.3.8
1415
sentry-sdk~=1.5.12
1516
sqlalchemy[mypy]~=1.4.31
1617

requirements.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile --cert=None --client-cert=None --index-url=None --pip-args=None '.\requirements.in'
5+
# pip-compile --cert=None --client-cert=None --index-url=None --pip-args=None requirements.in
66
#
77
alembic==1.16.4
88
# via flask-migrate
99
annotated-types==0.7.0
1010
# via pydantic
11+
astroid==3.3.11
12+
# via pylint
1113
blinker==1.9.0
1214
# via flask-mail
1315
bytecode==0.16.2
@@ -26,12 +28,14 @@ click==7.1.2
2628
# pip-tools
2729
cryptography==45.0.6
2830
# via oic
29-
csh-ldap @ git+https://github.com/costowell/csh_ldap.git@v2.5.0
31+
csh-ldap @ git+https://github.com/ComputerScienceHouse/csh_ldap.git@2.5.0
3032
# via -r requirements.in
3133
ddtrace==3.12.2
3234
# via -r requirements.in
3335
defusedxml==0.7.1
3436
# via oic
37+
dill==0.4.0
38+
# via pylint
3539
dnspython==2.7.0
3640
# via srvlookup
3741
envier==0.6.1
@@ -68,6 +72,8 @@ importlib-metadata==8.7.0
6872
# via opentelemetry-api
6973
importlib-resources==6.5.2
7074
# via flask-pyoidc
75+
isort==6.0.1
76+
# via pylint
7177
itsdangerous==1.1.0
7278
# via flask
7379
jinja2==2.11.3
@@ -81,6 +87,8 @@ markupsafe==2.0.1
8187
# -r requirements.in
8288
# jinja2
8389
# mako
90+
mccabe==0.7.0
91+
# via pylint
8492
mypy==1.17.1
8593
# via
8694
# -r requirements.in
@@ -99,6 +107,8 @@ pep517==0.13.1
99107
# via pip-tools
100108
pip-tools==6.6.2
101109
# via -r requirements.in
110+
platformdirs==4.4.0
111+
# via pylint
102112
protobuf==6.32.0
103113
# via ddtrace
104114
psycopg2-binary==2.9.10
@@ -123,6 +133,8 @@ pydantic-settings==2.10.1
123133
# via oic
124134
pyjwkest==1.4.2
125135
# via oic
136+
pylint==3.3.8
137+
# via -r requirements.in
126138
python-dotenv==1.1.1
127139
# via pydantic-settings
128140
python-ldap==3.4.4
@@ -148,6 +160,8 @@ sqlalchemy2-stubs==0.0.2a38
148160
# via sqlalchemy
149161
srvlookup==2.0.0
150162
# via csh-ldap
163+
tomlkit==0.13.3
164+
# via pylint
151165
typing-extensions==4.14.1
152166
# via
153167
# alembic

0 commit comments

Comments
 (0)