Skip to content

Commit

Permalink
Add ruff configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
raylu committed Apr 27, 2024
1 parent f6e6867 commit d384763
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/devtest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2

import sys
sys.path.insert(0, '/usr/share/dstat/')
Expand Down
2 changes: 1 addition & 1 deletion examples/mmpipe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2
import select, sys, os

def readpipe(file, tmout = 0.001):
Expand Down
2 changes: 1 addition & 1 deletion examples/mstat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2

### Example2: simple sub-second monitor (ministat)

Expand Down
2 changes: 1 addition & 1 deletion examples/read.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2

### Example 1: Direct accessing stats
### This is a quick example showing how you can access dstat data
Expand Down
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,27 @@ dool = "dool:__main"

[tool.flit.sdist]
exclude = [".github/*", ".gitignore", "docs/*", "examples/*", "install.py", "packaging/*", "Makefile"]

[tool.ruff]
line-length = 130
[tool.ruff.lint]
select = [
'E', 'F',
'YTT', 'COM', 'T10', 'ISC', 'G', 'PIE', 'Q', 'RSE',
'PLC', 'PLE',
'RUF',
]
ignore = [
'E701', # multiple-statements-on-one-line-colon
'E702', # multiple-statements-on-one-line-semicolon
'E741', # ambiguous-variable-name
'F821', # undefined-name
'COM819', # prohibited-trailing-comma
'RUF005', # collection-literal-concatenation
]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = 'double'
inline-quotes = 'single'
multiline-quotes = 'single'
[tool.ruff.lint.isort]
lines-after-imports = 1

0 comments on commit d384763

Please sign in to comment.