Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Move to ruff for CI #109

Open
wants to merge 20 commits into
base: devel
Choose a base branch
from

Conversation

gmuloc
Copy link
Collaborator

@gmuloc gmuloc commented Oct 1, 2024

  • drop Python 3.8 support
  • Move to ruff to lint
  • Refactor functions to use pathlib.Path in several places

lint_warnings
a dictionary containing pairs of type {filename: list of warnings}
verbose
When True, output a string when no error nor warning was passed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When True, output a string when no error nor warning was passed.
When True, output a string if neither an error nor a warning was passed.

Returns
-------
tuple[int, int]
A two tuple containing the total number of errors and the total number of warnings.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A two tuple containing the total number of errors and the total number of warnings.
A tuple containing the total number of errors and the total number of warnings.

CONSOLE.rule(f"[bold red]JINJA2 LINT {issue_type}")
for key, issues in lint_issues.items():
if not issues:
continue
tree = Tree(f"{key}")

for j2_issue in issues:
tree.add(j2_issue.to_rich(verbose))
tree.add(j2_issue.to_rich(verbose=verbose))
CONSOLE.print(tree)

total_lint_errors = sum(len(issues) for _, issues in lint_errors.items())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
total_lint_errors = sum(len(issues) for _, issues in lint_errors.items())
total_lint_errors = sum(len(issues) for issues in lint_errors.values())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for warnings, not able to add comment on the line below

Copy link

sonarcloud bot commented Oct 28, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants