Skip to content

Commit

Permalink
Upgrade ruff and fix lint errors (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
allenporter authored Jul 20, 2024
1 parent fba79d0 commit 0809d7d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
[lint]
ignore = ["E501"]
select = [
"ASYNC210", # Async functions should not call blocking HTTP methods
"ASYNC220", # Async functions should not create subprocesses with blocking methods
"ASYNC221", # Async functions should not run processes with blocking methods
"ASYNC222", # Async functions should not wait on processes with blocking methods
"ASYNC230", # Async functions should not open files with blocking methods like open
"ASYNC251", # Async functions should not call time.sleep
]
2 changes: 1 addition & 1 deletion ical/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def _validate_duration_unit(cls, values: dict[str, Any]) -> dict[str, Any]:
if not (duration := values.get("duration")):
return values
dtstart = values["dtstart"]
if type(dtstart) == datetime.date: # pylint: disable=unidiomatic-typecheck
if type(dtstart) is datetime.date:
if duration.seconds != 0:
raise ValueError("Event with start date expects duration in days only")
if duration < datetime.timedelta(seconds=0):
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pip==24.1.2
pre-commit==3.7.1
pytest-cov==5.0.0
pytest==8.2.2
ruff==0.5.1
ruff==0.5.4

python-dateutil==2.9.0.post0
freezegun==1.5.1
Expand Down

0 comments on commit 0809d7d

Please sign in to comment.