Skip to content

Commit 4dd4040

Browse files
committed
chore: minor updates
1 parent e4d69bc commit 4dd4040

10 files changed

Lines changed: 25 additions & 28 deletions

File tree

.github/workflows/python_lint_and_test.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ jobs:
3232
- name: Run python style and linting tools
3333
run: |
3434
err=0
35-
echo pre-commit:
3635
pre-commit install
37-
pre-commit run --all-files --hook-stage pre-commit|| err=$?
36+
pre-commit run --all-files --hook-stage pre-commit || err=$?
3837
exit $err
3938
- name: Run tests with coverage
4039
run: |

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# manual stage - runs the same tools but modifies files
44
# run as: pre-commit run --all-files --hook-stage manual
55
repos:
6+
# See README.md for more information on this pre-commit hook
7+
# Please uncomment this hook if you are a Red Hat employee, and make sure you don't commit it back upstream
68
# - repo: https://gitlab.cee.redhat.com/infosec-public/developer-workbench/tools.git
79
# rev: rh-pre-commit-2.3.0
810
# hooks:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ For details on debugging the web interactions, see the `--pwdebug` option in the
178178

179179
### Linting and formatting rules
180180

181-
This project uses `pre-commit` to handle linting and formatting. The `pre-commit` tool reads its configuration from [`.pre-commit-config.yaml`](./.pre-commit-config.yaml)` and the configuration options for the individual linters and formatters can be found in the [`pyproject.toml`](./pyproject.toml) file.
181+
This project uses `pre-commit` to handle linting and formatting. The `pre-commit` tool reads its configuration from [`.pre-commit-config.yaml`](./.pre-commit-config.yaml) and the configuration options for the individual linters and formatters can be found in the [`pyproject.toml`](./pyproject.toml) file.
182182
The same configuration is used in CI.
183183

184184
To install and execute it locally, follow these steps:

logilica_cli/__main__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
"-o",
4343
"output_dir_path",
4444
type=click.Path(
45-
writable=True,
46-
file_okay=False,
47-
path_type=pathlib.Path,
48-
resolve_path=True,
45+
writable=True, file_okay=False, path_type=pathlib.Path, resolve_path=True
4946
),
5047
default=DEFAULT_OUTPUT_DIR,
5148
show_default=True,

logilica_cli/data_sources.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
@common_options
1111
@click.pass_context
1212
def data_sources(
13-
context: click.Context,
14-
username: str,
15-
password: str,
16-
domain: str,
17-
oauth: bool,
13+
context: click.Context, username: str, password: str, domain: str, oauth: bool
1814
) -> None:
1915
"""Synchronizes configuration of integrations with the configuration file.
2016

logilica_cli/page_dashboard.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class DashboardPage:
99
PDF_EXPORT_TIMEOUT = 120000
1010

1111
def __init__(self, page: Page):
12-
# PDF generation might take longer than default 30000 ms timeout, so modify for this page in global
13-
# It can be export or download button that takes time to become visible
12+
# PDF generation might take longer than default 30000 ms timeout,
13+
# so modify for this page in global.
14+
# It can be export or download button that takes time to become visible.
1415
page.set_default_timeout(self.PDF_EXPORT_TIMEOUT)
1516
self.page = page
1617
self.export_pdf_button = page.get_by_role("button", name="Export PDF")

logilica_cli/page_navigation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def navigate(self, *, menu_dropdown: Optional[str], link_name: str) -> None:
2626

2727
link_locator = self.page.get_by_role("link", name=link_name)
2828

29-
# if dropdown argument was provided, check if dropdown is open as it hides the link
29+
# If dropdown argument was provided, check if dropdown is open as
30+
# it hides the link
3031
if menu_dropdown:
3132
for first_try in (True, False):
3233
try:

logilica_cli/page_settings.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def sync_integrations(self, integrations: dict[str, Any]) -> None:
7979
in integrations sections of the local configuration file.
8080
8181
Raises:
82-
RuntimeError: If any repositories could not have been added to the configuration.
82+
RuntimeError:
83+
If any repositories could not have been added to the configuration.
8384
"""
8485

8586
sync_failures: IntegrationSyncFailures = defaultdict(list)
@@ -279,7 +280,8 @@ def has_entity_imported(
279280
) -> bool:
280281
search_field.fill(entity_id)
281282

282-
# here we need to find the innermost div element that exactly matches repository slug
283+
# Here we need to find the innermost div element
284+
# that exactly matches repository slug.
283285
found = self.page.get_by_text(text=entity_id, exact=True).nth(0).is_visible()
284286
if found:
285287
logging.debug("✅%s '%s' is imported", entity_type, entity_id)
@@ -323,8 +325,8 @@ def add_public_repository(
323325
self.add_public_repository_dialog_button.click()
324326
self.add_public_repository_input.fill(f"{host}/{entity_id}.git")
325327
self.add_public_repository_confirm_button.click()
326-
# as UI refresh is triggered independently of the click and there is no guarantee the repository will be added
327-
# at the top of the page, we don't validate the action success here but later
328+
# UI refresh is triggered independently of the click and there is no guarantee
329+
# the repository will be added at the top of the page, we'll validate it later
328330
return True
329331

330332
def add_membership_entity(
@@ -374,8 +376,8 @@ def control_button(self, entity_id: str, *, order=0) -> Optional[Locator]:
374376
.get_by_role("button")
375377
)
376378

377-
# there might be the same slug in both imported repositories and available repositories
378-
# in that case, we want to be able to select one specifically
379+
# There might be the same slug in both imported repositories and available
380+
# repositories, in that case, we want to be able to select one specifically.
379381
count = locator.count()
380382
if count == 1:
381383
return locator

logilica_cli/update_gdoc.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,7 @@ def get_app_credentials_file(config: dict[str, any]) -> Path:
182182

183183

184184
GPP_SIGNATURE = Callable[
185-
[
186-
Optional[str],
187-
Optional[Union[str, Literal[False]]],
188-
Optional[str],
189-
bool,
190-
bool,
191-
],
185+
[Optional[str], Optional[Union[str, Literal[False]]], Optional[str], bool, bool],
192186
Path,
193187
]
194188

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ select = [
2121
"E", # pycodestyle (flake8)
2222
"F", # pyflakes (flake8)
2323
"I", # isort
24+
"W505", # docstring line too long
2425
]
2526
ignore = ["E501"] # line length is covered by black
2627

@@ -30,9 +31,13 @@ known-first-party = ["logilica_cli"] # use separate section for project sources
3031
force-sort-within-sections = true # don't separate import vs from
3132
order-by-type = false # sort alphabetic regardless of case
3233

34+
[tool.ruff.lint.pycodestyle]
35+
max-doc-length = 88
36+
3337

3438
[tool.black]
3539
line-length = 88
40+
skip-string-normalization = false
3641
skip-magic-trailing-comma = false
3742
include = '\.pyi?$'
3843

0 commit comments

Comments
 (0)