Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ruff to ci #2051

Merged
merged 61 commits into from
Apr 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9262be2
Initial attempt at ruff
richardebeling Oct 2, 2023
94a5a62
Progress
richardebeling Oct 9, 2023
8a56e8b
prohibit FIXME, TODO and XXX
Kakadus Oct 23, 2023
ab8b453
add zip strict parameter
Kakadus Oct 23, 2023
c911e90
import Callable from collections.abc
Kakadus Oct 23, 2023
5b46b3d
add ignores in settings
Kakadus Oct 23, 2023
ee949d0
add __all__
Kakadus Oct 23, 2023
d47105b
add stacklevel to warning, when top level code is executed twice
Kakadus Oct 23, 2023
6db57f3
add ruff ignores to pylint ignores
Kakadus Oct 23, 2023
39662a3
add some more rules
Kakadus Oct 30, 2023
dee96bf
add DJ checks
Kakadus Oct 30, 2023
c747b28
improve comments (fixup!)
Kakadus Nov 13, 2023
fdcbe48
ruff formatter
Kakadus Nov 13, 2023
aa6d58e
enable "free" tests
Kakadus Nov 13, 2023
5dd6441
replace pylint disables with ruff
Kakadus Nov 13, 2023
037041c
enable and (auto) fix set|list|map literal
Kakadus Nov 13, 2023
fbfa113
enable and (auto) fix implicit string concat
Kakadus Nov 13, 2023
587e99e
enable and (auto) fix unnecessary start in range
Kakadus Nov 13, 2023
61b5a78
enable and (auto) fix exception parentheses
Kakadus Nov 13, 2023
8446461
enable and (auto) fix unnecessary assignment
Kakadus Nov 13, 2023
c0a8502
enable COMpatible COM
Kakadus Nov 13, 2023
5830d4b
enable and fix unspecific ignore
Kakadus Nov 13, 2023
333889e
enable and fix string join
Kakadus Nov 13, 2023
22d4a79
enable and fix list comprehensions
Kakadus Nov 13, 2023
3173077
enable some pylint rules
Kakadus Nov 20, 2023
07770ca
rerun ci
Kakadus Nov 20, 2023
002736a
attr defined mypy ignore
Kakadus Nov 20, 2023
6aecca3
Fix spelling and grammar
Kakadus Dec 24, 2023
afaf098
enable PL, but keep invalid-name
Kakadus Dec 29, 2023
3c06cf8
enable PERF203 and BLE instead of broad-exception-caught
Kakadus Dec 29, 2023
9e88552
add pylint disable (why?!)
Kakadus Dec 29, 2023
b1b969e
change warning stacklevel to 3
Kakadus Dec 29, 2023
f6eb6ab
Merge remote-tracking branch 'upstream/main' into ruff
Kakadus Dec 29, 2023
d73931c
don't break github
Kakadus Jan 29, 2024
b6bf08b
don't break github 2
Kakadus Jan 29, 2024
feda4b1
don't break github 3
Kakadus Jan 29, 2024
6e978e1
don't break github 4
Kakadus Jan 29, 2024
b819c0e
Revert "don't break github 4"
Kakadus Jan 29, 2024
6596072
Revert "don't break github 3"
Kakadus Jan 29, 2024
1d8763c
Revert "don't break github 2"
Kakadus Jan 29, 2024
84a0712
bump ruff
Kakadus Jan 29, 2024
6203ce7
Merge branch 'main' into ruff
Kakadus Jan 29, 2024
22507ee
fix strict last unstrict zip (oops)
Kakadus Jan 29, 2024
c787d4b
add comment and don't break github?
Kakadus Feb 12, 2024
8037532
add comment and don't break github? again!
Kakadus Feb 12, 2024
b292520
Update pyproject.toml
Kakadus Feb 26, 2024
49290e4
Use correct weekday range
Kakadus Feb 26, 2024
f9f74c8
change unaddressed rule comment
Kakadus Feb 26, 2024
ea5e4d2
Merge remote-tracking branch 'upstream' into ruff
Kakadus Feb 26, 2024
ea14cce
fix errors introduced in latest changes
Kakadus Feb 26, 2024
5baa043
run ruff first and then pylint. Also do this with manage.py
Kakadus Feb 26, 2024
9a8e1ce
adapt test accordingly
Kakadus Feb 26, 2024
a4edc17
update ruff to latest and migrate settings
Kakadus Feb 26, 2024
cb34395
Merge remote-tracking branch 'upstream/main' into ruff
Kakadus Feb 26, 2024
2e9518c
do not print in commands, use stdout instead!
Kakadus Mar 4, 2024
0a8a056
Merge remote-tracking branch 'upstream/main' into ruff
Kakadus Apr 8, 2024
2a9ccf1
update ruff
Kakadus Apr 8, 2024
8656a54
Merge remote-tracking branch 'upstream/main' into ruff
Kakadus Apr 8, 2024
84a9b1d
Merge remote-tracking branch 'upstream/main' into ruff
Kakadus Apr 8, 2024
cceca4c
lint enrollment_preprocessor
Kakadus Apr 8, 2024
aa4da6b
sort imports
Kakadus Apr 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change warning stacklevel to 3
Kakadus committed Dec 29, 2023
commit b1b969e227d4d1f149c145371609d6773b76ae08
2 changes: 1 addition & 1 deletion evap/results/exporters.py
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ def init_grade_styles(cls):
"This can happen, if the file is imported / run multiple "
"times in one application run.",
ImportWarning,
stacklevel=2,
stacklevel=3,
Kakadus marked this conversation as resolved.
Show resolved Hide resolved
)
return


Unchanged files with check annotations Beta

return []
def create_user(self, claims):
return self.UserModel.objects.create(

Check warning on line 146 in evap/evaluation/auth.py

Codecov / codecov/patch

evap/evaluation/auth.py#L146

Added line #L146 was not covered by tests
email=claims.get("email"),
first_name_given=claims.get("given_name", ""),
last_name=claims.get("family_name", ""),
from evap.grades.models import GradeDocument
if not self.grade_documents_can_be_deleted:
raise NotArchivableError

Check warning on line 122 in evap/evaluation/models.py

Codecov / codecov/patch

evap/evaluation/models.py#L122

Added line #L122 was not covered by tests
GradeDocument.objects.filter(course__semester=self).delete()
self.grade_documents_are_deleted = True
self.save()
def archive_results(self):
if not self.results_can_be_archived:
raise NotArchivableError

Check warning on line 129 in evap/evaluation/models.py

Codecov / codecov/patch

evap/evaluation/models.py#L129

Added line #L129 was not covered by tests
self.results_are_archived = True
self.save()
logger.info('Sent email "%s" to %s.', mail.subject, user.full_name_with_additional_info)
if send_separate_login_url:
self.send_login_url_to_user(user)
except Exception:

Check warning on line 2095 in evap/evaluation/models.py

Codecov / codecov/patch

evap/evaluation/models.py#L2095

Added line #L2095 was not covered by tests
logger.exception(
'An exception occurred when sending the following email to user "%s":\n%s\n',
user.full_name_with_additional_info,
return instance
def is_external_email(email: str) -> bool:

Check warning on line 83 in evap/evaluation/tools.py

Codecov / codecov/patch

evap/evaluation/tools.py#L83

Added line #L83 was not covered by tests
return not any(email.endswith("@" + domain) for domain in settings.INSTITUTION_EMAIL_DOMAINS)
@abstractmethod
def __init__(self, location: ExcelFileLocation, *cells: Iterable[str]):
pass

Check warning on line 184 in evap/staff/importers/base.py

Codecov / codecov/patch

evap/staff/importers/base.py#L184

Added line #L184 was not covered by tests
@classmethod
def from_cells(cls, location: ExcelFileLocation, cells: Iterable[str]):