unref 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unref-0.0.1/.github/PULL_REQUEST_TEMPLATE.md +17 -0
- unref-0.0.1/.github/actionlint.yaml +7 -0
- unref-0.0.1/.github/workflows/ci.yml +80 -0
- unref-0.0.1/.github/workflows/release.yml +40 -0
- unref-0.0.1/.github/workflows/util/setup_python/action.yml +44 -0
- unref-0.0.1/.gitignore +18 -0
- unref-0.0.1/CONTRIBUTING.md +46 -0
- unref-0.0.1/LICENSE +21 -0
- unref-0.0.1/PKG-INFO +46 -0
- unref-0.0.1/README.md +24 -0
- unref-0.0.1/linters/cspell/words.txt +28 -0
- unref-0.0.1/linters/cspell.json +12 -0
- unref-0.0.1/linters/mypy.toml +105 -0
- unref-0.0.1/linters/ruff.toml +130 -0
- unref-0.0.1/linters/taplo.toml +2 -0
- unref-0.0.1/linters/ty.toml +38 -0
- unref-0.0.1/linters/yamllint.yaml +19 -0
- unref-0.0.1/prek.toml +101 -0
- unref-0.0.1/pyproject.toml +48 -0
- unref-0.0.1/scripts/release.py +108 -0
- unref-0.0.1/src/unref/__init__.py +1 -0
- unref-0.0.1/src/unref/py.typed +0 -0
- unref-0.0.1/tests/__init__.py +0 -0
- unref-0.0.1/tests/coverage.toml +9 -0
- unref-0.0.1/tests/pytest.ini +24 -0
- unref-0.0.1/tests/test_package.py +8 -0
- unref-0.0.1/uv.lock +704 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## What
|
|
2
|
+
|
|
3
|
+
<!-- One or two lines: what this changes and why. Link the issue, e.g. "Refs #8". -->
|
|
4
|
+
|
|
5
|
+
## Details
|
|
6
|
+
|
|
7
|
+
<!--
|
|
8
|
+
For a detection change, show a small Python example and the findings it now produces.
|
|
9
|
+
Delete this section for pure refactors / docs / tooling.
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
## Notes
|
|
13
|
+
|
|
14
|
+
<!--
|
|
15
|
+
Anything a reviewer needs: scope boundaries, known limitations, or explicit
|
|
16
|
+
out-of-scope behavior. Delete if there's nothing to add.
|
|
17
|
+
-->
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
# A new push to a PR supersedes its in-flight run; manual runs are never cancelled.
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
linters:
|
|
16
|
+
name: Linters
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v7
|
|
20
|
+
|
|
21
|
+
- name: Setup Python
|
|
22
|
+
uses: ./.github/workflows/util/setup_python
|
|
23
|
+
|
|
24
|
+
- name: prek cache
|
|
25
|
+
uses: actions/cache@v6
|
|
26
|
+
with:
|
|
27
|
+
path: ~/.cache/prek
|
|
28
|
+
key: ci-prek-cache-${{ hashFiles('prek.toml') }}
|
|
29
|
+
|
|
30
|
+
- name: Run prek
|
|
31
|
+
run: prek run -v --show-diff-on-failure --color=always --all-files
|
|
32
|
+
|
|
33
|
+
type-check:
|
|
34
|
+
strategy:
|
|
35
|
+
matrix:
|
|
36
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
37
|
+
|
|
38
|
+
name: Type Checks - Python ${{ matrix.python-version }}
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v7
|
|
42
|
+
|
|
43
|
+
- uses: ./.github/workflows/util/setup_python
|
|
44
|
+
with:
|
|
45
|
+
python-version: ${{ matrix.python-version }}
|
|
46
|
+
|
|
47
|
+
- name: Run mypy
|
|
48
|
+
run: mypy --config-file linters/mypy.toml .
|
|
49
|
+
|
|
50
|
+
- name: Run ty
|
|
51
|
+
run: ty check --project . --config-file linters/ty.toml --python-version ${{ matrix.python-version }}
|
|
52
|
+
|
|
53
|
+
unit-tests:
|
|
54
|
+
strategy:
|
|
55
|
+
fail-fast: false
|
|
56
|
+
matrix:
|
|
57
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
58
|
+
|
|
59
|
+
name: Unit Tests - Python ${{ matrix.python-version }}
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v7
|
|
63
|
+
|
|
64
|
+
- uses: ./.github/workflows/util/setup_python
|
|
65
|
+
with:
|
|
66
|
+
python-version: ${{ matrix.python-version }}
|
|
67
|
+
|
|
68
|
+
- name: Run unit tests
|
|
69
|
+
run: pytest --showlocals -c tests/pytest.ini
|
|
70
|
+
|
|
71
|
+
check:
|
|
72
|
+
name: Check All
|
|
73
|
+
if: always()
|
|
74
|
+
needs: [linters, type-check, unit-tests]
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
steps:
|
|
77
|
+
- name: Decide whether the needed jobs succeeded or failed
|
|
78
|
+
uses: re-actors/alls-green@v1.3.0
|
|
79
|
+
with:
|
|
80
|
+
jobs: ${{ toJSON(needs) }}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
release:
|
|
11
|
+
# A manual run on a branch would build a dev version (.devN+g<hash>) that PyPI rejects,
|
|
12
|
+
# so only release from a version tag.
|
|
13
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
# Required for PyPI Trusted Publishing (OIDC), so no API token is stored.
|
|
18
|
+
id-token: write
|
|
19
|
+
# Required to create the GitHub Release.
|
|
20
|
+
contents: write
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v7
|
|
24
|
+
with:
|
|
25
|
+
# hatch-vcs derives the version from the git tag, so it needs the
|
|
26
|
+
# full history and tags, not a shallow clone.
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- uses: ./.github/workflows/util/setup_python
|
|
30
|
+
|
|
31
|
+
- name: Build
|
|
32
|
+
run: uv build
|
|
33
|
+
|
|
34
|
+
- name: Publish to PyPI
|
|
35
|
+
run: uv publish --trusted-publishing always
|
|
36
|
+
|
|
37
|
+
- name: Create GitHub Release
|
|
38
|
+
uses: softprops/action-gh-release@v3
|
|
39
|
+
with:
|
|
40
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Setup Python
|
|
2
|
+
description: Install Python, uv and dependencies.
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
python-version:
|
|
6
|
+
description: Python version to install.
|
|
7
|
+
default: "3.14"
|
|
8
|
+
resolution:
|
|
9
|
+
description: uv resolution strategy (e.g. lowest-direct). Empty installs the locked versions.
|
|
10
|
+
default: ""
|
|
11
|
+
|
|
12
|
+
runs:
|
|
13
|
+
using: "composite"
|
|
14
|
+
steps:
|
|
15
|
+
- name: Setup uv
|
|
16
|
+
uses: astral-sh/setup-uv@v10.3.2
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ inputs.python-version }}
|
|
19
|
+
enable-cache: true
|
|
20
|
+
|
|
21
|
+
- name: Install Python dependencies
|
|
22
|
+
shell: bash
|
|
23
|
+
env:
|
|
24
|
+
RESOLUTION: ${{ inputs.resolution }}
|
|
25
|
+
run: |
|
|
26
|
+
if [ -n "$RESOLUTION" ]; then
|
|
27
|
+
uv sync --resolution "$RESOLUTION"
|
|
28
|
+
else
|
|
29
|
+
uv sync --frozen
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Put the project virtual environment on PATH for subsequent steps, so tools can be
|
|
33
|
+
# invoked directly (e.g. `pytest`). Uses $GITHUB_PATH, which is applied
|
|
34
|
+
# regardless of the step's shell and works on all runners.
|
|
35
|
+
- name: Activate Python venv
|
|
36
|
+
shell: bash
|
|
37
|
+
run: |
|
|
38
|
+
if [ -d .venv/Scripts ]; then
|
|
39
|
+
# Windows layout ('.venv/Scripts'); '$(pwd -W)' yields a Windows-style path.
|
|
40
|
+
echo "$(pwd -W)/.venv/Scripts" >> "$GITHUB_PATH"
|
|
41
|
+
else
|
|
42
|
+
# Unix layout ('.venv/bin').
|
|
43
|
+
echo "$(pwd)/.venv/bin" >> "$GITHUB_PATH"
|
|
44
|
+
fi
|
unref-0.0.1/.gitignore
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Contributing to unref
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing! To contribute, open a pull request with your changes, or an
|
|
4
|
+
issue with your bug or request.
|
|
5
|
+
|
|
6
|
+
All checks (linters, type checks, and tests) run automatically in CI through GitHub Actions.
|
|
7
|
+
|
|
8
|
+
## Development environment
|
|
9
|
+
|
|
10
|
+
Local development is done with [uv](https://docs.astral.sh/uv/getting-started/installation/).
|
|
11
|
+
|
|
12
|
+
Install all the development dependencies:
|
|
13
|
+
|
|
14
|
+
```shell
|
|
15
|
+
uv sync
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Running checks locally
|
|
19
|
+
|
|
20
|
+
Run the linters with `prek`:
|
|
21
|
+
|
|
22
|
+
```shell
|
|
23
|
+
uv run prek run -a
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Run the unit tests with `pytest`:
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
uv run pytest -c tests/pytest.ini tests
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Run the type checks with `mypy` and `ty` (both run in CI):
|
|
33
|
+
|
|
34
|
+
```shell
|
|
35
|
+
uv run mypy --config-file linters/mypy.toml .
|
|
36
|
+
uv run ty check --project . --config-file linters/ty.toml
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Releasing
|
|
40
|
+
|
|
41
|
+
To release a new version, run the interactive script (it requires the [`gh`](https://cli.github.com/) CLI,
|
|
42
|
+
authenticated against the repository):
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
uv run scripts/release.py
|
|
46
|
+
```
|
unref-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yossi Rozantsev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
unref-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: unref
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Find unreferenced Python code
|
|
5
|
+
Project-URL: homepage, https://github.com/Apakottur/unref
|
|
6
|
+
Project-URL: repository, https://github.com/Apakottur/unref
|
|
7
|
+
Author: Yossi Rozantsev
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: dead-code,linter,static-analysis,unused-code
|
|
11
|
+
Classifier: Development Status :: 1 - Planning
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
[](https://pypi.python.org/pypi/unref)
|
|
24
|
+
[](https://github.com/Apakottur/unref/blob/main/LICENSE)
|
|
25
|
+
[](https://pypi.python.org/pypi/unref)
|
|
26
|
+
|
|
27
|
+
# unref
|
|
28
|
+
|
|
29
|
+
Find unreferenced Python code.
|
|
30
|
+
|
|
31
|
+
`unref` reports the functions, classes and methods in a Python codebase that nothing references.
|
|
32
|
+
|
|
33
|
+
> [!NOTE]
|
|
34
|
+
> `unref` is in early development and does not do anything useful yet.
|
|
35
|
+
|
|
36
|
+
## Why
|
|
37
|
+
|
|
38
|
+
Finding dead code needs whole-program analysis: a function is unused only if no file in the project
|
|
39
|
+
references it. [Ruff](https://docs.astral.sh/ruff/) analyses one file at a time and does not have this
|
|
40
|
+
feature yet, see [astral-sh/ruff#872](https://github.com/astral-sh/ruff/issues/872).
|
|
41
|
+
|
|
42
|
+
Use `unref` today, and migrate when Ruff ships it.
|
|
43
|
+
|
|
44
|
+
## Contributing
|
|
45
|
+
|
|
46
|
+
See [CONTRIBUTING.md](https://github.com/Apakottur/unref/blob/main/CONTRIBUTING.md).
|
unref-0.0.1/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[](https://pypi.python.org/pypi/unref)
|
|
2
|
+
[](https://github.com/Apakottur/unref/blob/main/LICENSE)
|
|
3
|
+
[](https://pypi.python.org/pypi/unref)
|
|
4
|
+
|
|
5
|
+
# unref
|
|
6
|
+
|
|
7
|
+
Find unreferenced Python code.
|
|
8
|
+
|
|
9
|
+
`unref` reports the functions, classes and methods in a Python codebase that nothing references.
|
|
10
|
+
|
|
11
|
+
> [!NOTE]
|
|
12
|
+
> `unref` is in early development and does not do anything useful yet.
|
|
13
|
+
|
|
14
|
+
## Why
|
|
15
|
+
|
|
16
|
+
Finding dead code needs whole-program analysis: a function is unused only if no file in the project
|
|
17
|
+
references it. [Ruff](https://docs.astral.sh/ruff/) analyses one file at a time and does not have this
|
|
18
|
+
feature yet, see [astral-sh/ruff#872](https://github.com/astral-sh/ruff/issues/872).
|
|
19
|
+
|
|
20
|
+
Use `unref` today, and migrate when Ruff ships it.
|
|
21
|
+
|
|
22
|
+
## Contributing
|
|
23
|
+
|
|
24
|
+
See [CONTRIBUTING.md](https://github.com/Apakottur/unref/blob/main/CONTRIBUTING.md).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
addopts
|
|
2
|
+
anyio
|
|
3
|
+
Apakottur
|
|
4
|
+
commitish
|
|
5
|
+
contextlib
|
|
6
|
+
docstrings
|
|
7
|
+
elif
|
|
8
|
+
httpx
|
|
9
|
+
ignorelist
|
|
10
|
+
isort
|
|
11
|
+
maxfail
|
|
12
|
+
mypy
|
|
13
|
+
pathlib
|
|
14
|
+
prek
|
|
15
|
+
pycache
|
|
16
|
+
Pydocstyle
|
|
17
|
+
pyproject
|
|
18
|
+
pytest
|
|
19
|
+
Rozantsev
|
|
20
|
+
showlocals
|
|
21
|
+
shpyx
|
|
22
|
+
softprops
|
|
23
|
+
subclassing
|
|
24
|
+
taplo
|
|
25
|
+
typeshed
|
|
26
|
+
unref
|
|
27
|
+
venv
|
|
28
|
+
Yossi
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# See: https://mypy.readthedocs.io/en/stable/config_file.html
|
|
2
|
+
|
|
3
|
+
[tool.mypy]
|
|
4
|
+
####################
|
|
5
|
+
# Import discovery #
|
|
6
|
+
####################
|
|
7
|
+
# Suppresses error messages about imports that cannot be resolved.
|
|
8
|
+
# This can be enabled per-module.
|
|
9
|
+
ignore_missing_imports = false
|
|
10
|
+
|
|
11
|
+
# See https://mypy.readthedocs.io/en/latest/running_mypy.html#following-imports
|
|
12
|
+
follow_imports = "normal"
|
|
13
|
+
follow_imports_for_stubs = true
|
|
14
|
+
|
|
15
|
+
##########################
|
|
16
|
+
# Platform configuration #
|
|
17
|
+
##########################
|
|
18
|
+
###########################
|
|
19
|
+
# Disallow dynamic typing #
|
|
20
|
+
###########################
|
|
21
|
+
disallow_any_unimported = true
|
|
22
|
+
disallow_any_expr = false
|
|
23
|
+
disallow_any_decorated = false
|
|
24
|
+
disallow_any_explicit = false
|
|
25
|
+
disallow_any_generics = true
|
|
26
|
+
disallow_subclassing_any = true
|
|
27
|
+
#################################
|
|
28
|
+
# Untyped definitions and calls #
|
|
29
|
+
#################################
|
|
30
|
+
disallow_untyped_calls = true
|
|
31
|
+
disallow_untyped_defs = true
|
|
32
|
+
disallow_incomplete_defs = true
|
|
33
|
+
check_untyped_defs = true
|
|
34
|
+
disallow_untyped_decorators = true
|
|
35
|
+
##############################
|
|
36
|
+
# None and Optional handling #
|
|
37
|
+
##############################
|
|
38
|
+
implicit_optional = false
|
|
39
|
+
strict_optional = true
|
|
40
|
+
########################
|
|
41
|
+
# Configuring warnings #
|
|
42
|
+
########################
|
|
43
|
+
warn_redundant_casts = true
|
|
44
|
+
warn_unused_ignores = true
|
|
45
|
+
warn_no_return = true
|
|
46
|
+
warn_return_any = true
|
|
47
|
+
warn_unreachable = true
|
|
48
|
+
######################
|
|
49
|
+
# Suppressing errors #
|
|
50
|
+
######################
|
|
51
|
+
ignore_errors = false
|
|
52
|
+
##################################
|
|
53
|
+
# Miscellaneous strictness flags #
|
|
54
|
+
##################################
|
|
55
|
+
allow_untyped_globals = false
|
|
56
|
+
allow_redefinition = true
|
|
57
|
+
local_partial_types = true
|
|
58
|
+
# disable_error_code=
|
|
59
|
+
# Optional error codes: https://mypy.readthedocs.io/en/stable/error_code_list2.html
|
|
60
|
+
enable_error_code = [
|
|
61
|
+
"redundant-self",
|
|
62
|
+
"redundant-expr",
|
|
63
|
+
"possibly-undefined",
|
|
64
|
+
"truthy-bool",
|
|
65
|
+
"truthy-iterable",
|
|
66
|
+
"ignore-without-code",
|
|
67
|
+
"unused-awaitable",
|
|
68
|
+
# "explicit-override",
|
|
69
|
+
"mutable-override",
|
|
70
|
+
"exhaustive-match",
|
|
71
|
+
]
|
|
72
|
+
extra_checks = false
|
|
73
|
+
implicit_reexport = false
|
|
74
|
+
strict_equality = true
|
|
75
|
+
strict_equality_for_none = true
|
|
76
|
+
strict_bytes = true
|
|
77
|
+
strict = true
|
|
78
|
+
##############################
|
|
79
|
+
# Configuring error messages #
|
|
80
|
+
##############################
|
|
81
|
+
show_error_context = false
|
|
82
|
+
show_column_numbers = true
|
|
83
|
+
show_error_code_links = false
|
|
84
|
+
hide_error_codes = false
|
|
85
|
+
# pretty=
|
|
86
|
+
color_output = true
|
|
87
|
+
error_summary = true
|
|
88
|
+
show_absolute_path = false
|
|
89
|
+
####################
|
|
90
|
+
# Incremental mode #
|
|
91
|
+
####################
|
|
92
|
+
incremental = true
|
|
93
|
+
####################
|
|
94
|
+
# Advanced options #
|
|
95
|
+
####################
|
|
96
|
+
plugins = []
|
|
97
|
+
warn_incomplete_stub = true
|
|
98
|
+
#####################
|
|
99
|
+
# Report generation #
|
|
100
|
+
#####################
|
|
101
|
+
#################
|
|
102
|
+
# Miscellaneous #
|
|
103
|
+
#################
|
|
104
|
+
warn_unused_configs = true
|
|
105
|
+
# verbosity=
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
########################
|
|
2
|
+
# Global configuration #
|
|
3
|
+
########################
|
|
4
|
+
|
|
5
|
+
# Maximum line length.
|
|
6
|
+
line-length = 120
|
|
7
|
+
|
|
8
|
+
# Minimum supported Python version.
|
|
9
|
+
target-version = "py311"
|
|
10
|
+
|
|
11
|
+
# Enable autofixing.
|
|
12
|
+
fix = true
|
|
13
|
+
|
|
14
|
+
# Output format, can be used to print more detailed errors.
|
|
15
|
+
output-format = "concise"
|
|
16
|
+
|
|
17
|
+
[format]
|
|
18
|
+
# Preview mode is unstable and should not be used.
|
|
19
|
+
preview = false
|
|
20
|
+
|
|
21
|
+
quote-style = "double"
|
|
22
|
+
indent-style = "space"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
[lint]
|
|
26
|
+
# Preview mode is unstable and should not be used.
|
|
27
|
+
preview = false
|
|
28
|
+
|
|
29
|
+
# Enable everything else.
|
|
30
|
+
select = ["ALL"]
|
|
31
|
+
fixable = ["ALL"]
|
|
32
|
+
unfixable = []
|
|
33
|
+
|
|
34
|
+
# Forcefully enable rules which are not enabled by 'ALL'.
|
|
35
|
+
extend-select = [
|
|
36
|
+
# Disabled by the Google convention:
|
|
37
|
+
# https://docs.astral.sh/ruff/settings/#lint_pydocstyle_convention
|
|
38
|
+
"D213", # Multi-line docstring summary should start at the second line
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
# Ignore rules.
|
|
42
|
+
ignore = [
|
|
43
|
+
###########################################
|
|
44
|
+
# Ignored - Conflicts with Ruff formatter #
|
|
45
|
+
###########################################
|
|
46
|
+
"COM812", # Trailing comma missing
|
|
47
|
+
"E501", # Line too long
|
|
48
|
+
"ISC001", # Implicitly concatenated strings on a single line
|
|
49
|
+
"ISC004", # Unparenthesized implicit string concatenation in collection
|
|
50
|
+
##############
|
|
51
|
+
# Pydocstyle #
|
|
52
|
+
##############
|
|
53
|
+
# See: http://www.pydocstyle.org/en/stable/error_codes.html
|
|
54
|
+
"D100", # Missing docstring in public module
|
|
55
|
+
"D101", # Missing docstring in public class
|
|
56
|
+
"D102", # Missing docstring in public method
|
|
57
|
+
"D103", # Missing docstring in public function
|
|
58
|
+
"D104", # Missing docstring in public package
|
|
59
|
+
"D105", # Missing docstring in magic method
|
|
60
|
+
"D106", # Missing docstring in public nested class
|
|
61
|
+
"D107", # Missing docstring in __init__
|
|
62
|
+
"D200", # One-line docstring should fit on one line with quotes
|
|
63
|
+
"D205", # 1 blank line required between summary line and description
|
|
64
|
+
"D212", # Multi-line docstring summary should start at the first line
|
|
65
|
+
"D415", # First line should end with a period, question mark, or exclamation point
|
|
66
|
+
###################################
|
|
67
|
+
# Other checks that we don't want #
|
|
68
|
+
###################################
|
|
69
|
+
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
|
|
70
|
+
"ASYNC109", # Async function definition with a `timeout` parameter
|
|
71
|
+
"ASYNC240", # Async functions should not use pathlib.Path methods, use trio.Path or anyio.path
|
|
72
|
+
"ASYNC250", # Blocking call to `input()` in async context
|
|
73
|
+
"BLE001", # Do not catch blind exception: `Exception`
|
|
74
|
+
"C901", # Method is too complex
|
|
75
|
+
"CPY001", # Missing copyright notice at top of file
|
|
76
|
+
"EM101", # Exception must not use a string literal, assign to variable first
|
|
77
|
+
"EM102", # Exception must not use an f-string literal, assign to variable first
|
|
78
|
+
"ERA001", # Found commented-out code
|
|
79
|
+
"FIX002", # Line contains TODO
|
|
80
|
+
"N818", # Exception name should be named with an Error suffix
|
|
81
|
+
"PLR0911", # Too many return statements
|
|
82
|
+
"PLR0912", # Too many branches
|
|
83
|
+
"PLR0913", # Too many arguments to function call
|
|
84
|
+
"PLR0915", # Too many statements
|
|
85
|
+
"PLR0917", # Too many positional arguments
|
|
86
|
+
"PLR1722", # Use `sys.exit()` instead of `exit`
|
|
87
|
+
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
|
|
88
|
+
"PLR5501", # Consider using `elif` instead of `else` then `if` to remove one indentation level
|
|
89
|
+
"PT003", # `scope='function'` is implied in `@pytest.fixture()`
|
|
90
|
+
"PTH123", # `open()` should be replaced by `Path.open()`
|
|
91
|
+
"RET505", # Unnecessary `else` after `return` statement
|
|
92
|
+
"RET506", # Unnecessary `else` after `raise` statement
|
|
93
|
+
"SIM102", # Use a single `if` statement instead of nested `if` statements
|
|
94
|
+
"SIM103", # Return the condition directly
|
|
95
|
+
"SIM105", # Use `contextlib.suppress()` instead of try-except-pass
|
|
96
|
+
"SIM108", # Use ternary operator `X` instead of `if`-`else`-block
|
|
97
|
+
"TC001", # Move application import into a type-checking block
|
|
98
|
+
"TC002", # Move third-party import into a type-checking block
|
|
99
|
+
"TC003", # Move standard library import into a type-checking block
|
|
100
|
+
"TD002", # Missing author in TODO
|
|
101
|
+
"TD003", # Missing issue link on the line following this TODO
|
|
102
|
+
"TRY003", # Avoid specifying long messages outside the exception class
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
[lint.isort]
|
|
106
|
+
# Import sorting configuration.
|
|
107
|
+
split-on-trailing-comma = false
|
|
108
|
+
known-first-party = ["unref"]
|
|
109
|
+
combine-as-imports = true
|
|
110
|
+
|
|
111
|
+
[lint.pydocstyle]
|
|
112
|
+
# Use Google-style docstrings.
|
|
113
|
+
convention = "google"
|
|
114
|
+
|
|
115
|
+
[lint.flake8-builtins]
|
|
116
|
+
# Ignore list of builtin names.
|
|
117
|
+
builtins-ignorelist = ["id"]
|
|
118
|
+
|
|
119
|
+
[lint.flake8-tidy-imports]
|
|
120
|
+
# Enforce absolute imports (TID252 only bans parent-relative by default).
|
|
121
|
+
ban-relative-imports = "all"
|
|
122
|
+
|
|
123
|
+
# Per file ignores.
|
|
124
|
+
[lint.per-file-ignores]
|
|
125
|
+
"tests/*" = [
|
|
126
|
+
"S101", # Use of `assert` detected
|
|
127
|
+
]
|
|
128
|
+
"scripts/*" = [
|
|
129
|
+
"T201", # `print` found
|
|
130
|
+
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# See: https://docs.astral.sh/ty/reference/configuration
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
[rules]
|
|
5
|
+
# All rules are errors by default.
|
|
6
|
+
all = "error"
|
|
7
|
+
|
|
8
|
+
# Disable specific rules.
|
|
9
|
+
unsupported-dynamic-base = "ignore"
|
|
10
|
+
missing-override-decorator = "ignore"
|
|
11
|
+
unsound-assignment = "ignore"
|
|
12
|
+
unsound-return-statement = "ignore"
|
|
13
|
+
unsound-yield = "ignore"
|
|
14
|
+
|
|
15
|
+
[analysis]
|
|
16
|
+
allowed-unresolved-imports = []
|
|
17
|
+
replace-imports-with-any = []
|
|
18
|
+
respect-type-ignore-comments = true
|
|
19
|
+
|
|
20
|
+
[environment]
|
|
21
|
+
extra-paths = []
|
|
22
|
+
# python =
|
|
23
|
+
# python-platform
|
|
24
|
+
python-version = "3.14"
|
|
25
|
+
# root = []
|
|
26
|
+
# typeshed =
|
|
27
|
+
|
|
28
|
+
# [[overrides]]
|
|
29
|
+
|
|
30
|
+
[src]
|
|
31
|
+
# exclude =
|
|
32
|
+
# include =
|
|
33
|
+
respect-ignore-files = true
|
|
34
|
+
|
|
35
|
+
[terminal]
|
|
36
|
+
error-on-warning = true
|
|
37
|
+
# output-format = "full"
|
|
38
|
+
output-format = "concise"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
extends: default
|
|
2
|
+
|
|
3
|
+
rules:
|
|
4
|
+
line-length:
|
|
5
|
+
max: 120
|
|
6
|
+
|
|
7
|
+
document-start:
|
|
8
|
+
present: false
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
comments:
|
|
12
|
+
require-starting-space: true
|
|
13
|
+
ignore-shebangs: true
|
|
14
|
+
min-spaces-from-content: 1
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
truthy:
|
|
18
|
+
allowed-values: ['true', 'false', 'on', 'off']
|
|
19
|
+
check-keys: true
|