Skip to content

Commit ee126df

Browse files
committed
change: move tools configuration to pyproject.toml
1 parent d34486b commit ee126df

File tree

6 files changed

+96
-100
lines changed

6 files changed

+96
-100
lines changed

.codespellrc

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

.cz.toml

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

.mypy.ini

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

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ repos:
2222
rev: v2.2.5
2323
hooks:
2424
- id: codespell
25+
additional_dependencies:
26+
- tomli
2527
- repo: https://github.com/espressif/conventional-precommit-linter
2628
rev: v1.4.0
2729
hooks:

.ruff.toml

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

pyproject.toml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,97 @@
6969

7070
[tool.setuptools.packages]
7171
find = {exclude = ["ci", "flasher_stub", "test", "docs"]}
72+
73+
[tool.setuptools.dynamic]
74+
version = {attr = "esptool.__init__.__version__"}
75+
76+
[tool.commitizen]
77+
version = "4.7.0"
78+
update_changelog_on_bump = true
79+
tag_format = "v$version"
80+
changelog_start_rev = "v4.2.1"
81+
changelog_merge_prerelease = true
82+
annotated_tag = true
83+
bump_message = "change: Update version to $new_version"
84+
version_files = [
85+
"esptool/__init__.py:__version__"
86+
]
87+
change_type_order = [
88+
"BREAKING CHANGE",
89+
"New Features",
90+
"Bug Fixes",
91+
"Code Refactoring",
92+
"Performance Improvements"
93+
]
94+
95+
[tool.commitizen.change_type_map]
96+
feat = "New Features"
97+
fix = "Bug Fixes"
98+
refactor = "Code Refactoring"
99+
perf = "Performance Improvements"
100+
101+
[tool.codespell]
102+
skip = '*.bin,*test/images/efuse/*,*docs/en/espefuse/inc/*'
103+
ignore-words-list = 'bloc,ser,dout,exten'
104+
write-changes = false
105+
106+
[tool.mypy]
107+
disallow_incomplete_defs = false # Disallows defining functions with incomplete type annotations
108+
disallow_untyped_defs = false # Disallows defining functions without type annotations or with incomplete type annotations
109+
ignore_missing_imports = true # Suppress error messages about imports that cannot be resolved
110+
python_version = "3.7" # Specifies the Python version used to parse and check the target program
111+
warn_no_return = true # Shows errors for missing return statements on some execution paths
112+
warn_return_any = true # Shows a warning when returning a value with type Any from a function declared with a non- Any return type
113+
114+
[tool.ruff]
115+
# https://docs.astral.sh/ruff/settings/
116+
# Exclude a variety of commonly ignored directories.
117+
exclude = [
118+
".eggs",
119+
".git",
120+
"__pycache__"
121+
]
122+
123+
line-length = 88
124+
125+
select = ['E', 'F', 'W']
126+
ignore = ["E203"]
127+
128+
target-version = "py37"
129+
130+
[tool.ruff.lint]
131+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
132+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
133+
# McCabe complexity (`C901`) by default.
134+
select = ["E4", "E7", "E9", "F"]
135+
ignore = []
136+
137+
# Allow fix for all enabled rules (when `--fix`) is provided.
138+
fixable = ["ALL"]
139+
unfixable = []
140+
141+
# Allow unused variables when underscore-prefixed.
142+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
143+
144+
[tool.ruff.lint.per-file-ignores]
145+
# tests often manipulate sys.path before importing the main tools, so ignore import order violations
146+
"test/*.py" = ["E402"]
147+
148+
# multiple spaces after ',' and long lines - used for visual layout of eFuse data
149+
"espefuse/efuse/*/mem_definition.py" = ["E241", "E501"]
150+
"espefuse/efuse/*/operations.py" = ["E241", "E501", "F401"]
151+
"espefuse/efuse/*/fields.py" = ["E241", "E501"]
152+
153+
# ignore long lines - used for RS encoding pairs
154+
"test/test_modules.py" = ["E501"]
155+
156+
# don't check for unused imports in __init__.py files
157+
"__init__.py" = ["F401"]
158+
159+
# allow definition from star imports in docs config
160+
"docs/conf_common.py" = ["F405"]
161+
162+
[tool.ruff.format]
163+
quote-style = "double"
164+
indent-style = "space"
165+
docstring-code-format = true

0 commit comments

Comments
 (0)