Skip to content
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ repos:
hooks:
# Run the linter.
- id: ruff-check
args: [--fix, --config=ruff.toml]
args: [--fix, --config=pyproject.toml]
# Run the formatter.
- id: ruff-format
args: [--config=ruff.toml]
args: [--config=pyproject.toml]

- repo: local
hooks:
Expand All @@ -36,20 +36,20 @@ repos:
entry: mypy
language: system
types: [python]
args: ["--config-file=mypy.ini"]
args: ["--config-file=pyproject.toml"]

- repo: https://github.com/crate-ci/typos
rev: v1.42.1
hooks:
- id: typos
args: [--config=typos.toml]
args: [--config=pyproject.toml]
pass_filenames: false

- repo: https://github.com/PyCQA/bandit
rev: 1.9.3
hooks:
- id: bandit
args: ["-c", "bandit.yaml"]
args: ["-c", "pyproject.toml"]

- repo: local
hooks:
Expand Down
1 change: 0 additions & 1 deletion bandit.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions mypy.ini

This file was deleted.

102 changes: 102 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,105 @@ packages = ["src/sre_agent"]

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"legacy",
]

# same as Black
line-length = 100
indent-width = 4

target-version = "py312"
force-exclude = true

[tool.ruff.lint]
select = [
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"Q", # flake8-quotes
"ISC", # flake8-implicit-str-concat
"F", # pyflakes
"D", # pydocstyle
"E", # pycodestyle error
"W", # pycodestyle warning
"N", # pep8-naming
"I", # isort
"PL", # pylint rules from categories "Convention", "Error", and "Warning"
"PLE", # ruff currently implements only a subset of pylint's rules
"PLW", # pylint warning
"PLR", # pylint refactor
"UP", # pyupgrade
"C", # Complexity (mccabe+) & comprehensions
]
ignore = [
"UP006", # See https://github.com/bokeh/bokeh/issues/13143
"UP007", # See https://github.com/bokeh/bokeh/pull/13144
"PLC0415", # Allow imports inside functions (useful for optional deps)
"PLR2004", # Allow magic values in comparisons (array indices etc.)
]

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.mypy]
exclude = ["docs/", "tests/", "LICENSE"]
strict = true
ignore_missing_imports = true

[tool.typos.files]
extend-exclude = [
".gitignore",
"LICENSE",
"legacy",
"*.csv"
]
ignore-hidden = true
ignore-dot = true

[tool.typos.default]
locale = "en-gb"
extend-ignore-re = [
# Ignore lines that end with `# spellchecker:disable-line`
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
# Ignore lines with HTML `<!-- spellchecker:disable-line -->`
"(?Rm)^.*<!--\\s*spellchecker:disable-line\\s*-->.*$",
# Ignore the line after `# spellchecker:ignore-next-line`:
"(#|//)\\s*spellchecker:ignore-next-line\\n.*",
# Ignore blocks between `# spellchecker:off` and `# spellchecker:on`
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
]

[tool.bandit]
exclude_dirs = ["tests"]
71 changes: 0 additions & 71 deletions ruff.toml

This file was deleted.

22 changes: 0 additions & 22 deletions typos.toml

This file was deleted.

Loading