Skip to content

Commit

Permalink
Add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
mikahanninen committed Dec 8, 2024
1 parent 10b4787 commit ab27cc7
Show file tree
Hide file tree
Showing 8 changed files with 1,105 additions and 224 deletions.
28 changes: 14 additions & 14 deletions invocations/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def lint(ctx, docstrings=False, all=False, exit_on_failure=False):
# is resolved.
pylint_jobs = " -j 1" if current_package_name == "rpaframework-hubspot" else ""
warn_setting = not exit_on_failure
flake8_config = Path(safely_load_config(ctx, "ctx.linters.flake8", FLAKE8_CONFIG))
#flake8_config = Path(safely_load_config(ctx, "ctx.linters.flake8", FLAKE8_CONFIG))
pylint_config = Path(safely_load_config(ctx, "ctx.linters.pylint", PYLINT_CONFIG))
if docstrings:
ignore_codes_cmd = ""
Expand All @@ -85,20 +85,20 @@ def lint(ctx, docstrings=False, all=False, exit_on_failure=False):
f"-b dummy -a -n --keep-going {docs.DOCS_SOURCE_DIR} {docs.DOCS_BUILD_DIR}",
warn=warn_setting,
)
shell.poetry(
ctx,
f"run flake8 --config {flake8_config} {docs.DOCS_SOURCE_DIR}",
warn=warn_setting,
)
# shell.poetry(
# ctx,
# f"run flake8 --config {flake8_config} {docs.DOCS_SOURCE_DIR}",
# warn=warn_setting,
# )
if all:
shell.invoke_each(ctx, f"code.lint {all_docstrings_cmd}")
else:
shell.poetry(ctx, "run black --diff --check src", warn=warn_setting)
shell.poetry(
ctx,
f"run flake8 --config {flake8_config} {ignore_codes_cmd} src",
warn=warn_setting,
)
# shell.poetry(ctx, "run black --diff --check src", warn=warn_setting)
# shell.poetry(
# ctx,
# f"run flake8 --config {flake8_config} {ignore_codes_cmd} src",
# warn=warn_setting,
# )
shell.poetry(
ctx,
f"run pylint --rcfile {pylint_config}{pylint_jobs} src",
Expand All @@ -111,8 +111,8 @@ def format_code(ctx):
"""Run code formatter on source files"""
if getattr(ctx, "is_meta", False):
shell.invoke_each(ctx, "code.format-code")
else:
shell.run_in_venv(ctx, "black", "src")
#else:
# shell.run_in_venv(ctx, "black", "src")


@task(
Expand Down
1 change: 1 addition & 0 deletions packages/devutils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# rpaframework devutils
911 changes: 911 additions & 0 deletions packages/devutils/poetry.lock

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions packages/devutils/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[tool.poetry]
name = "rpaframework-devutils"
version = "0.0.1"
description = "Utilities for development in monorepo."
authors = [
"Mika H. <[email protected]>"
]
readme = "README.md"
packages = [{include = "devutils", from="src"}]

[tool.poetry.dependencies]
python = "^3.9"
ruff = "^0.1.14"
mypy = "^1.1.1"
pytest = "^7.2.2"
pytest-xdist = "^3.2.1"
pytest-regressions = "1.0.6"
pytest-cov = "^4.0.0"
isort = { version = "^5.12.0", python = "^3.8" }
types-invoke = "^2.0"
invoke = "^2.2.0" # keep in sync with requirements.txt
tomlkit = "^0.11.8" # keep in sync with requirements.txt
semver = "^3.0.0" # keep in sync with requirements.txt
pylint = "^3.3.2"
robotframework-docgen = "^0.16.0"
colorama = "^0.4.5"
keyring = "^24.2.0"
PyYAML = ">=5.4.1,<7.0.0"



[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file.
Empty file.
Loading

0 comments on commit ab27cc7

Please sign in to comment.