Enable Ruff PTH for the script directory (#124441)
* Enable Ruff PTH for the script directory * Address review comments * Fix translations script * Update script/hassfest/config_flow.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
7752789c3a
commit
1db68327f9
18 changed files with 125 additions and 163 deletions
|
@ -103,9 +103,9 @@ LABEL "com.github.actions.color"="gray-dark"
|
|||
"""
|
||||
|
||||
|
||||
def _get_package_versions(file: str, packages: set[str]) -> dict[str, str]:
|
||||
def _get_package_versions(file: Path, packages: set[str]) -> dict[str, str]:
|
||||
package_versions: dict[str, str] = {}
|
||||
with open(file, encoding="UTF-8") as fp:
|
||||
with file.open(encoding="UTF-8") as fp:
|
||||
for _, line in enumerate(fp):
|
||||
if package_versions.keys() == packages:
|
||||
return package_versions
|
||||
|
@ -173,10 +173,10 @@ def _generate_files(config: Config) -> list[File]:
|
|||
) * 1000
|
||||
|
||||
package_versions = _get_package_versions(
|
||||
"requirements_test.txt", {"pipdeptree", "tqdm", "uv"}
|
||||
Path("requirements_test.txt"), {"pipdeptree", "tqdm", "uv"}
|
||||
)
|
||||
package_versions |= _get_package_versions(
|
||||
"requirements_test_pre_commit.txt", {"ruff"}
|
||||
Path("requirements_test_pre_commit.txt"), {"ruff"}
|
||||
)
|
||||
|
||||
return [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue