Skip to content

Commit eb40e18

Browse files
committed
fix linting
1 parent 915b869 commit eb40e18

File tree

7 files changed

+184
-234
lines changed

7 files changed

+184
-234
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
- name: "Mypy Tests"
7575
run: "poetry run mypy --show-error-codes ."
7676
- name: "Pylint Tests"
77-
run: "poetry run pylint . *.py"
77+
run: "poetry run pylint ."
7878

7979
yaml-lint:
8080
name: Run yaml lint

.metadata.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# yamllint disable rule:line-length
23
base:
34
description: The base schemas serve as the foundation for every single schema extension
45
you might want to use afterward. This one is mandatory and will unlock access

poetry.lock

Lines changed: 173 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package-mode = false
99
python = "^3.10, < 3.13"
1010
infrahub-sdk = { version = "^1", extras = ["all"]}
1111
invoke = "^2.1.2"
12+
pylint = "^3.3.4"
1213

1314
[tool.poetry.group.dev.dependencies]
1415
ruff = "^0.9.1"

tasks.old

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

tasks/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ def lint_all(context: Context) -> None:
1414
linter.lint_all(context)
1515

1616

17-
@task(name="format")
18-
def format(context: Context) -> None:
19-
linter.format(context)
17+
@task(name="format_code")
18+
def format_code(context: Context) -> None:
19+
linter.format_code(context)
2020

2121

2222
ns.add_task(lint_all)
23-
ns.add_task(format)
23+
ns.add_task(format_code)

tasks/linter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
METADATA_FILE = ".metadata.yml"
1010

1111

12-
@task
13-
def format(context: Context) -> None:
12+
@task(name="format_code")
13+
def format_code(context: Context) -> None:
1414
"""Run RUFF to format all Python files."""
1515

1616
exec_cmds = ["ruff format .", "ruff check . --fix"]
@@ -72,7 +72,7 @@ class PreserveLiteralStyleDumper(yaml.SafeDumper):
7272
"""
7373

7474
def increase_indent(self, flow=False, indentless=False):
75-
return super(PreserveLiteralStyleDumper, self).increase_indent(flow, False)
75+
return super().increase_indent(flow, False)
7676

7777
def represent_scalar(self, tag, value, style=None):
7878
if "\n" in value: # If the string contains newlines, use literal style
@@ -87,7 +87,7 @@ def sort_metadata(context: Context) -> None:
8787
metadata = yaml.safe_load(f)
8888

8989
with open(METADATA_FILE, "w", encoding="utf-8") as f:
90-
f.write("---\n")
90+
f.write("---\n# yamllint disable rule:line-length\n")
9191
yaml.dump(
9292
metadata,
9393
f,

0 commit comments

Comments
 (0)