Skip to content

Commit eb768f8

Browse files
committed
small tweaks
1 parent 4a6239b commit eb768f8

4 files changed

Lines changed: 135 additions & 163 deletions

File tree

example.env

Lines changed: 0 additions & 8 deletions
This file was deleted.

locations.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

pyproject.toml

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -34,112 +34,3 @@ homepage = "https://github.com/AD-SDL/mir_module"
3434
requires = ["setuptools>=61", "wheel"]
3535
build-backend = "setuptools.build_meta"
3636

37-
#####################
38-
# Development Tools #
39-
#####################
40-
41-
[tool.ruff]
42-
# https://docs.astral.sh/ruff/configuration/
43-
44-
# Exclude a variety of commonly ignored directories.
45-
exclude = [
46-
".bzr",
47-
".direnv",
48-
".eggs",
49-
".git",
50-
".git-rewrite",
51-
".hg",
52-
".mypy_cache",
53-
".nox",
54-
".pants.d",
55-
".pytype",
56-
".ruff_cache",
57-
".svn",
58-
".tox",
59-
".venv",
60-
"__pypackages__",
61-
"_build",
62-
"buck-out",
63-
"build",
64-
"dist",
65-
"node_modules",
66-
"venv",
67-
"docs",
68-
]
69-
70-
# Same as Black.
71-
line-length = 120
72-
indent-width = 4
73-
74-
# Assume Python 3.8
75-
target-version = "py38"
76-
77-
[tool.ruff.lint]
78-
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
79-
select = [
80-
# pycodestyle
81-
"E",
82-
# Pyflakes
83-
"F",
84-
# pyupgrade
85-
# "UP",
86-
# flake8-bugbear
87-
"B",
88-
# flake8-simplify
89-
# "SIM",
90-
# isort
91-
"I",
92-
# Warning
93-
"W",
94-
# pydocstyle
95-
"D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107",
96-
# ruff
97-
# "RUF"
98-
]
99-
ignore = [
100-
"E501", # Line too long
101-
"B006", # Do not use mutable data structures for argument defaults
102-
]
103-
104-
# Allow fix for all enabled rules (when `--fix`) is provided.
105-
fixable = ["ALL"]
106-
unfixable = []
107-
108-
# Allow unused variables when underscore-prefixed.
109-
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
110-
111-
[tool.ruff.format]
112-
# Like Black, use double quotes for strings.
113-
quote-style = "double"
114-
115-
# Like Black, indent with spaces, rather than tabs.
116-
indent-style = "space"
117-
118-
# Like Black, respect magic trailing commas.
119-
skip-magic-trailing-comma = false
120-
121-
# Like Black, automatically detect the appropriate line ending.
122-
line-ending = "auto"
123-
124-
[tool.pytest.ini_options]
125-
# https://docs.pytest.org/en/stable/customize.html
126-
addopts = "-x"
127-
junit_family="xunit1"
128-
filterwarnings = [
129-
"ignore::DeprecationWarning",
130-
"ignore::pottery.exceptions.InefficientAccessWarning",
131-
]
132-
markers = [
133-
"hardware: marks test as requiring hardware (deselect with '-m \"not hardware\"')",
134-
]
135-
136-
[tool.mypy]
137-
# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml
138-
show_error_codes = true
139-
check_untyped_defs = true
140-
follow_imports = "normal"
141-
strict_optional = true
142-
plugins = ["pydantic.mypy"]
143-
strict = true
144-
disallow_untyped_defs = true
145-
implicit_reexport = true

ruff.toml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# https://docs.astral.sh/ruff/configuration/
2+
3+
# Exclude a variety of commonly ignored directories.
4+
exclude = [
5+
".bzr",
6+
".direnv",
7+
".eggs",
8+
".git",
9+
".git-rewrite",
10+
".hg",
11+
".mypy_cache",
12+
".nox",
13+
".pants.d",
14+
".pytype",
15+
".ruff_cache",
16+
".svn",
17+
".tox",
18+
".venv",
19+
"__pypackages__",
20+
"_build",
21+
"buck-out",
22+
"build",
23+
"dist",
24+
"node_modules",
25+
"venv",
26+
".venv",
27+
"docs",
28+
"*.ipynb",
29+
"*.md",
30+
]
31+
32+
# Same as Black.
33+
line-length = 88
34+
indent-width = 4
35+
36+
# Assume Python 3.10
37+
target-version = "py310"
38+
39+
[lint]
40+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
41+
select = [
42+
# pycodestyle
43+
"E",
44+
# Pyflakes
45+
"F",
46+
# pyupgrade
47+
"UP",
48+
# flake8-bugbear
49+
"B",
50+
# flake8-simplify
51+
"SIM",
52+
# isort
53+
"I",
54+
# Warning
55+
"W",
56+
# pydocstyle
57+
"D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107",
58+
# ruff
59+
"RUF",
60+
# McCabe Complexity
61+
"C90",
62+
# pep8-naming (N)
63+
"N",
64+
# flake8-2020 (YTT)
65+
"YTT",
66+
# flake8-annotations (ANN)
67+
"ANN",
68+
# flake8-async
69+
"ASYNC",
70+
# flake8-bandit
71+
"S",
72+
# flake8-commas
73+
"COM",
74+
# flake8-use-pathlib
75+
"PTH",
76+
# FastAPI
77+
"FAST",
78+
# flake8-logging
79+
"LOG",
80+
# flake8-comprehensions
81+
"C4",
82+
# flake8-pie
83+
"PIE",
84+
# flake8-return
85+
"RET",
86+
# Pylint
87+
"PL",
88+
# eradicate
89+
"ERA",
90+
# refurb
91+
"FURB",
92+
# flake-8-unused-arguments
93+
"ARG",
94+
# flake-8-print
95+
"T20",
96+
]
97+
ignore = [
98+
"E501", # Line too long
99+
"B006", # Do not use mutable data structures for argument defaults
100+
"ANN401", # Don't flag Any types
101+
"COM812", # Don't fight over trailing commas
102+
"PLR0913", # Allow for a reasonable number of arguments
103+
"PLR2004", # Magic value used in comparison
104+
"UP006", # Ignoring errors for typing types such as Dict or List
105+
"UP045", # Ignoring errors for Unions
106+
"UP007", # Ignoring errors for Optional
107+
"UP035", # Ignoring errors for typing types such as Dict or List
108+
"S311", # Ignoring use of standard random number generators
109+
]
110+
111+
# Allow fix for all enabled rules (when `--fix`) is provided.
112+
fixable = ["ALL"]
113+
unfixable = []
114+
115+
# Allow unused variables when underscore-prefixed.
116+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
117+
118+
[lint.per-file-ignores]
119+
"**/tests/**/*.py" = ["S101", "ANN", "D", "ARG002"]
120+
"**/*.ipynb" = ["T20"]
121+
"scripts/**/*.py" = ["D", "T20", "S101", "C901", "SIM", "C401"]
122+
"**/cli/**/*.py" = ["PLC0415"] # Allow lazy imports in CLI for startup performance
123+
124+
[format]
125+
# Like Black, use double quotes for strings.
126+
quote-style = "double"
127+
128+
# Like Black, indent with spaces, rather than tabs.
129+
indent-style = "space"
130+
131+
# Like Black, respect magic trailing commas.
132+
skip-magic-trailing-comma = false
133+
134+
# Like Black, automatically detect the appropriate line ending.
135+
line-ending = "auto"

0 commit comments

Comments
 (0)