This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass configuration via separate class (#2)
Signed-off-by: Bernát Gábor <[email protected]>
- Loading branch information
1 parent
f25874e
commit 7f3b782
Showing
8 changed files
with
121 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ requires = [ | |
|
||
[project] | ||
name = "pyproject-fmt-rust" | ||
version = "1.0.0" | ||
version = "1.0.1" | ||
description = "Format your pyproject.toml file" | ||
readme = "README.md" | ||
keywords = [ | ||
|
@@ -15,7 +15,7 @@ keywords = [ | |
] | ||
license.file = "LICENSE.txt" | ||
authors = [ | ||
{ name = "Bernat Gabor", email = "[email protected]" }, | ||
{ name = "Bernat Gabor", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
|
@@ -51,35 +51,35 @@ module-name = "pyproject_fmt_rust._lib" | |
python-source = "src" | ||
strip = true | ||
include = [ | ||
"rust-toolchain.toml", | ||
"rust-toolchain.toml", | ||
] | ||
|
||
[tool.cibuildwheel] | ||
skip = [ | ||
"pp*", | ||
"*musl*", | ||
"pp*", | ||
"*musl*", | ||
] | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
target-version = "py38" | ||
lint.isort = { known-first-party = [ | ||
"pyproject_fmt_rust", | ||
"pyproject_fmt_rust", | ||
], required-imports = [ | ||
"from __future__ import annotations", | ||
"from __future__ import annotations", | ||
] } | ||
lint.select = [ | ||
"ALL", | ||
"ALL", | ||
] | ||
lint.ignore = [ | ||
"ANN101", # no type annotation for self | ||
"ANN401", # allow Any as type annotation | ||
"COM812", # Conflict with formatter | ||
"CPY", # No copyright statements | ||
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible | ||
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible | ||
"ISC001", # Conflict with formatter | ||
"S104", # Possible binding to all interface | ||
"ANN101", # no type annotation for self | ||
"ANN401", # allow Any as type annotation | ||
"COM812", # Conflict with formatter | ||
"CPY", # No copyright statements | ||
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible | ||
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible | ||
"ISC001", # Conflict with formatter | ||
"S104", # Possible binding to all interface | ||
] | ||
lint.preview = true | ||
format.preview = true | ||
|
@@ -88,15 +88,15 @@ format.docstring-code-line-length = 100 | |
|
||
[tool.ruff.lint.per-file-ignores] | ||
"tests/**/*.py" = [ | ||
"D", # don"t care about documentation in tests | ||
"FBT", # don"t care about booleans as positional arguments in tests | ||
"INP001", # no implicit namespace | ||
"PLC2701", # private import | ||
"PLR0913", # any number of arguments in tests | ||
"PLR0917", # any number of arguments in tests | ||
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable | ||
"S101", # asserts allowed in tests... | ||
"S603", # `subprocess` call: check for execution of untrusted input | ||
"D", # don"t care about documentation in tests | ||
"FBT", # don"t care about booleans as positional arguments in tests | ||
"INP001", # no implicit namespace | ||
"PLC2701", # private import | ||
"PLR0913", # any number of arguments in tests | ||
"PLR0917", # any number of arguments in tests | ||
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable | ||
"S101", # asserts allowed in tests... | ||
"S603", # `subprocess` call: check for execution of untrusted input | ||
] | ||
|
||
[tool.codespell] | ||
|
@@ -105,25 +105,25 @@ count = true | |
|
||
[tool.pytest] | ||
ini_options.testpaths = [ | ||
"tests", | ||
"tests", | ||
] | ||
|
||
[tool.coverage] | ||
html.show_contexts = true | ||
html.skip_covered = false | ||
paths.source = [ | ||
"src", | ||
".tox/*/.venv/lib/*/site-packages", | ||
".tox\\*\\.venv\\Lib\\site-packages", | ||
".tox/*/lib/*/site-packages", | ||
".tox\\*\\Lib\\site-packages", | ||
"**/src", | ||
"**\\src", | ||
"src", | ||
".tox/*/.venv/lib/*/site-packages", | ||
".tox\\*\\.venv\\Lib\\site-packages", | ||
".tox/*/lib/*/site-packages", | ||
".tox\\*\\Lib\\site-packages", | ||
"**/src", | ||
"**\\src", | ||
] | ||
report.fail_under = 100 | ||
run.parallel = true | ||
run.plugins = [ | ||
"covdefaults", | ||
"covdefaults", | ||
] | ||
|
||
[tool.mypy] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
def format_toml( # noqa: PLR0913 | ||
content: str, | ||
*, | ||
column_width: int, | ||
indent: int, | ||
keep_full_version: bool, | ||
max_supported_python: tuple[int, int], | ||
min_supported_python: tuple[int, int], | ||
) -> str: ... | ||
class Settings: | ||
def __init__( # noqa: PLR0913 | ||
self, | ||
*, | ||
column_width: int, | ||
indent: int, | ||
keep_full_version: bool, | ||
max_supported_python: tuple[int, int], | ||
min_supported_python: tuple[int, int], | ||
) -> None: ... | ||
@property | ||
def column_width(self) -> int: ... | ||
@property | ||
def indent(self) -> int: ... | ||
@property | ||
def keep_full_version(self) -> bool: ... | ||
@property | ||
def max_supported_python(self) -> tuple[int, int]: ... | ||
@property | ||
def min_supported_python(self) -> tuple[int, int]: ... | ||
|
||
def format_toml(content: str, settings: Settings) -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters