Skip to content

Commit

Permalink
Add RoboTidy
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Mar 29, 2024
1 parent c1eb611 commit 49431db
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,13 @@ lint.select = [
testpaths = ["utest"]
log_format = "%(asctime)s %(levelname)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"

[tool.robotidy]
lineseparator = "unix"
configure = [
"NormalizeAssignments:equal_sign_type=space_and_equal_sign",
"NormalizeAssignments:equal_sign_type_variables=space_and_equal_sign",
"NormalizeNewLines:section_lines=1",
"RenameTestCases:enabled=True:capitalize_each_word=True",
"RenameKeywords:enabled=True",
]
10 changes: 10 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from invoke import task


Expand All @@ -12,6 +14,14 @@ def lint(ctx, fix=False):
if fix:
ruff_cmd = f"{ruff_cmd} --fix"
ctx.run(ruff_cmd)
in_ci = os.getenv("GITHUB_WORKFLOW")
print(f"Lint Robot files {'in ci' if in_ci else ''}")
cmd = ["robotidy", "atest"]
if in_ci:
cmd.insert(1, "--check")
cmd.insert(1, "--diff")
print(cmd)
ctx.run(" ".join(cmd))


@task
Expand Down

0 comments on commit 49431db

Please sign in to comment.