Skip to content

Commit

Permalink
Merge branch 'main' into ruff_PIE
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored May 31, 2024
2 parents 3c0d6b0 + 85adec1 commit 5d3a6ea
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ disable = [
enable = [
"useless-suppression" # Identify unneeded pylint disable statements
]
fail-on = [
"useless-suppression"
]

[tool.pytest.ini_options]
# do not add xdist options here as this will make running of a single test and
Expand Down Expand Up @@ -281,8 +284,6 @@ ignore = [
'FBT001', # Boolean positional arg in function definition
'FBT002', # Boolean default value in function definition
'FBT003', # Boolean positional value in function call
'FIX001', # Line contains FIXME
'FIX002', # Line contains TODO
'N802', # Function name `formatTime` should be lowercase
'N806', # Variable `FType` in function should be lowercase
'N812', # Lowercase `__version_collection_doc_cache__` imported as non-lowercase `VERSION_CDC`
Expand Down Expand Up @@ -321,10 +322,7 @@ ignore = [
'S605', # Starting a process with a shell, possible injection detected
'S607', # Starting a process with a partial executable path
'SLF001', # Private member accessed: `_ui`
'T201', # `print` found
'TD001', # Invalid TODO tag: `FIXME`
'TD002', # Missing author in TODO
'TD003' # Missing issue link on the line following this TODO
'T201' # `print` found
]
select = ["ALL"]

Expand Down
2 changes: 0 additions & 2 deletions src/ansible_navigator/data/catalog_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ def identify_missing(


def parse_args() -> tuple[argparse.Namespace, list[Path]]:
# pylint: disable=used-before-assignment
# pylint: disable=possibly-used-before-assignment
"""Parse the arguments from the command line.
Expand Down Expand Up @@ -596,7 +595,6 @@ def run_command(cmd: list[str]) -> dict[str, str]:

def main() -> dict[Any, Any]:
# pylint: disable=protected-access
# pylint: disable=used-before-assignment
# pylint: disable=possibly-used-before-assignment
"""Run the collection catalog process.
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/tm_tokenize/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def _captures(
rule = compiler.compile_rule(u_rule)
start, end = match.span(i)
if start < pos:
# TODO: could maybe bisect but this is probably fast enough
# could maybe bisect but this is probably fast enough
j = len(ret) - 1
while j > 0 and start < ret[j - 1].end:
j -= 1
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/tm_tokenize/tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def tokenize(
pos = 0
boundary = state.cur.boundary

# TODO: this is still a little wasteful
# this is still a little wasteful
while_stack = []
for while_rule, idx in state.while_stack:
while_stack.append((while_rule, idx))
Expand Down
6 changes: 3 additions & 3 deletions src/ansible_navigator/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def console_width() -> int:
return 132


# TODO: Replace this with something type-safe.
# Replace this with something type-safe.
def dispatch(obj: object, replacements: tuple[tuple[str, str], ...]) -> object:
"""Make the replacement based on type.
Expand Down Expand Up @@ -432,8 +432,8 @@ def str2bool(value: Any) -> bool:
raise ValueError


# TODO: We are kind-of screwed type-wise by the fact that ast.literal_eval()
# returns Any. Need to find a better solution... "Any" isn't it.
# We are kind-of screwed type-wise by the fact that ast.literal_eval()
# returns Any. Need to find a better solution... "Any" isn't it.
def templar(string: str, template_vars: Mapping[Any, Any]) -> tuple[list[str], Any]:
"""Template some string with jinja2 always to and from json.
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/configuration_subsystem/test_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os


# pylint: disable=preferred-module # FIXME: remove once migrated per GH-872
# pylint: disable=preferred-module
from collections.abc import Callable
from copy import deepcopy
from typing import Any
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Literal
from typing import NamedTuple

# pylint: disable=preferred-module # FIXME: remove once migrated per GH-872
# pylint: disable=preferred-module
from unittest.mock import patch

import pytest
Expand Down

0 comments on commit 5d3a6ea

Please sign in to comment.