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

setup ruff as a flake8 replacement #31

Merged
merged 5 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ jobs:

- name: Run style checks
run: python -m black . --check

- name: Run ruff linter
run: python -m ruff check .
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ repos:
entry: black . --check
language: system
pass_filenames: false
- id: flake8-check
name: Check PEP8
entry: flake8
- id: ruff-check
name: Run ruff linter
entry: ruff check .
language: system
pass_filenames: false
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dev = [
"pre-commit>=2.20.0,<2.21.0",
"pytest-cov>=4.0.0,<4.1.0",
"pytest>=7.2.0,<7.3.0",
"ruff>=0.3.0,<0.4.0",
]

[project.urls]
Expand All @@ -66,3 +67,10 @@ addopts = "--cov=dakara_feeder"

[tool.isort]
profile = "black"

[tool.ruff]
line-length = 88

[tool.ruff.lint]
select = ["E", "F", "W", "B"]
ignore = []
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions src/dakara_feeder/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ class SongPaths:
others (list of path.Path): Paths of other files.
"""

def __init__(self, video, audio=None, subtitle=None, others=[]):
def __init__(self, video, audio=None, subtitle=None, others=None):
self.video = video
self.audio = audio
self.subtitle = subtitle
self.others = others
self.others = [] if others is None else others

def __eq__(self, other):
return self.__hash__() == other.__hash__()
Expand Down
4 changes: 2 additions & 2 deletions src/dakara_feeder/subtitle/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class SubtitleParser(ABC):
object or the full text of the lyrics.
"""

def __init__(self, content={}):
self.content = content
def __init__(self, content=None):
self.content = {} if content is None else content

@classmethod
@abstractmethod
Expand Down
Loading