Skip to content

Commit b6b3130

Browse files
committed
Fixed linting
1 parent 521fddf commit b6b3130

8 files changed

Lines changed: 17 additions & 22 deletions

File tree

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/physics-workload.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ install: ## install library
1818
.PHONY: lint lints fix format
1919

2020
lint: ## run python linter with ruff
21-
python -m ruff check physics-workload app core users
22-
python -m ruff format --check physics-workload app core users
21+
python -m ruff check physics_workload
22+
python -m ruff format --check physics_workload
2323

2424
# Alias
2525
lints: lint
2626

2727
fix: ## fix python formatting with ruff
28-
python -m ruff check --fix physics-workload app core users
29-
python -m ruff format physics-workload app core users
28+
python -m ruff check --fix physics_workload
29+
python -m ruff format physics_workload
3030

3131
# alias
3232
format: fix

physics_workload/app/models/task.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Task(ModelCommon):
4545

4646
# === CHANGEABLE FIELDS ===
4747
name = CharField(max_length=128, blank=False) # A hidden, uneditable, qualified name
48-
title = CharField(max_length=128, blank=False) # The editable version of the name
48+
title = CharField(max_length=128, blank=False) # The editable version of the name
4949

5050
is_required = BooleanField(
5151
default=False,
@@ -146,9 +146,7 @@ class Task(ModelCommon):
146146
# ==========================================================================
147147
# TaskFullTime components. Polymorphism and SimpleHistory don't play nice.
148148
# ==========================================================================
149-
FIELDS_TASK_FULL_TIME = (
150-
"is_full_time",
151-
)
149+
FIELDS_TASK_FULL_TIME = ("is_full_time",)
152150

153151
is_full_time = BooleanField(
154152
default=False, verbose_name="Is full-time", help_text="If set, makes this task counts as being 1 FTE worth of load. Recursively defined."
@@ -380,7 +378,6 @@ def calculate_load(self, students: int | None, is_first_time: bool = False) -> f
380378
return load_calc * self.load_multiplier
381379

382380

383-
384381
@receiver(pre_save, sender=Task)
385382
def update_task_name(sender: Type[Task], instance: Task, **kwargs):
386383
"""
@@ -391,6 +388,7 @@ def update_task_name(sender: Type[Task], instance: Task, **kwargs):
391388
"""
392389
instance.name = instance.get_name()
393390

391+
394392
#
395393
# @receiver(post_delete, sender=Task)
396394
# def update_related_models(sender: Type[Task], instance: Task, **kwargs):

physics_workload/app/pages/staff/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,8 @@ class StaffDetail(Page):
135135
editable=False,
136136
actions__submit=None,
137137
)
138-
assignments_editable = AssignmentStaffEditTable(
139-
include=lambda user, **_: user.is_staff
140-
)
141-
assignments = AssignmentStaffTable(
142-
include=lambda user, **_: not user.is_staff
143-
)
138+
assignments_editable = AssignmentStaffEditTable(include=lambda user, **_: user.is_staff)
139+
assignments = AssignmentStaffTable(include=lambda user, **_: not user.is_staff)
144140

145141

146142
class StaffList(Page):

physics_workload/app/tables/assignment.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ class Meta:
6161

6262

6363
class AssignmentStaffEditTable(EditTable):
64-
"""
64+
""" """
6565

66-
"""
6766
class Meta:
6867
auto = dict(
6968
model=Assignment,

physics_workload/manage.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
import os
77
import sys
88

9+
910
def main():
10-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
11+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
1112
try:
1213
from django.core.management import execute_from_command_line
1314
except ImportError as exc:
@@ -18,5 +19,6 @@ def main():
1819
) from exc
1920
execute_from_command_line(sys.argv)
2021

21-
if __name__ == '__main__':
22+
23+
if __name__ == "__main__":
2224
main()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ extend-select = ["I"]
140140
[tool.ruff.lint.isort]
141141
combine-as-imports = true
142142
default-section = "third-party"
143-
known-first-party = ["physics_workload"]
143+
known-first-party = ["physics_workload", "app", "core", "users"]
144144
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
145145

146146
[tool.ruff.lint.per-file-ignores]

0 commit comments

Comments
 (0)