Skip to content

Commit

Permalink
dest_path can be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
nagareproject committed Feb 19, 2024
1 parent 84a63ab commit 55bf8f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.1.14"
rev: "v0.2.2"
hooks:
- id: ruff
- id: ruff-format
22 changes: 8 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ Source = 'https://github.com/nagareproject/services-reloader'
Tracker = 'https://github.com/nagareproject/services-reloader/issues'

[tool.ruff]
src = ['src']
line-length = 120
format.quote-style = 'single'

[tool.ruff.lint]
select = [
'C4',
'COM',
Expand All @@ -67,20 +72,9 @@ select = [
'YTT',
]
ignore = ['COM812', 'D10', 'D401', 'S603', 'ISC001']
line-length = 120
src = ['src']

[tool.ruff.flake8-quotes]
inline-quotes = 'single'

[tool.ruff.pydocstyle]
convention = 'google'

[tool.ruff.isort]
length-sort = true

[tool.ruff.format]
quote-style = 'single'
isort.length-sort = true
pydocstyle.convention = 'google'
flake8-quotes.inline-quotes = 'single'

[tool.pytest.ini_options]
testpaths = ['tests']
2 changes: 1 addition & 1 deletion src/nagare/services/reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def dispatch(self, event):
if event.is_directory:
return

filename = getattr(event, 'dest_path', event.src_path)
filename = getattr(event, 'dest_path', None) or event.src_path
dirname = os.path.dirname(filename)
basename = os.path.basename(filename)

Expand Down

0 comments on commit 55bf8f8

Please sign in to comment.