Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
chore(linting): reenable SLF001 and noqa current occurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Apr 18, 2024
1 parent 94e16ad commit a7079e4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ ignore = [
"COM812", # ignore due to conflict with formatter
"ISC001", # ignore due to conflict with formatter
"E501", # managed by formatter
"SLF001", # allow accessing private members
"TD002", # don't require author of TODO
"TD003", # don't require link to TODO
"D100", # don't enforce existance of docstrings
Expand Down
2 changes: 1 addition & 1 deletion timed/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def register_module(module):
for _name, obj in inspect.getmembers(module):
if isinstance(obj, FactoryMetaClass) and not obj._meta.abstract:
if isinstance(obj, FactoryMetaClass) and not obj._meta.abstract: # noqa: SLF001
register(obj)


Expand Down
2 changes: 1 addition & 1 deletion timed/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_serializer(self, data=None, *args, **kwargs):
# prefetch data for all related fields
prefetch_per_field = {}
serializer_class = self.get_serializer_class()
for key, value in serializer_class._declared_fields.items():
for key, value in serializer_class._declared_fields.items(): # noqa: SLF001
if self._is_related_field(value):
source = value.source or key
if many:
Expand Down
4 changes: 2 additions & 2 deletions timed/reports/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def filter_queryset(self, queryset):

duration_ref = self._refs["reports_ref"] + "__duration"

full_qs = qs._base.annotate(
full_qs = qs._base.annotate( # noqa: SLF001
duration=Coalesce(
Sum(duration_ref, filter=qs._agg_filters),
Sum(duration_ref, filter=qs._agg_filters), # noqa: SLF001
Value("00:00:00", DurationField(null=False)),
),
pk=F("id"),
Expand Down
2 changes: 1 addition & 1 deletion timed/reports/tests/test_work_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_generate_work_report_name(customer_name, project_name, expected):
# slashes should be dropped from file name
project = ProjectFactory.create(customer=customer, name=project_name)

name = view._generate_workreport_name(test_date, test_date, project)
name = view._generate_workreport_name(test_date, test_date, project) # noqa: SLF001
assert name == expected


Expand Down
2 changes: 1 addition & 1 deletion timed/reports/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def filter_base(self, *args, **kwargs):
def _clone(self):
return StatisticQueryset(
model=self.model,
base_qs=self._base._clone(),
base_qs=self._base._clone(), # noqa: SLF001
catch_prefixes=self._catch_prefixes,
agg_filters=self._agg_filters,
)
Expand Down

0 comments on commit a7079e4

Please sign in to comment.