Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1664)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black.git: 23.12.1 → 24.1.1](https://github.com/psf/black.git/compare/23.12.1...24.1.1)
- [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.2.0](astral-sh/ruff-pre-commit@v0.1.9...v0.2.0)
- [github.com/streetsidesoftware/cspell-cli: v8.2.1 → v8.3.0](streetsidesoftware/cspell-cli@v8.2.1...v8.3.0)
- [github.com/igorshubovych/markdownlint-cli: v0.38.0 → v0.39.0](igorshubovych/markdownlint-cli@v0.38.0...v0.39.0)
- [github.com/PyCQA/flake8.git: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8.git/compare/6.1.0...7.0.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix ruff SIM401

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: shatakshiiii <shatakshimishra01@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and shatakshiiii authored Feb 6, 2024
1 parent 4570254 commit ba3cdfc
Show file tree
Hide file tree
Showing 204 changed files with 226 additions and 54 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
- prettier-plugin-toml

- repo: https://github.com/psf/black.git
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
language_version: python3
Expand All @@ -45,14 +45,14 @@ repos:
- id: toml-sort-fix

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.9"
rev: "v0.2.0"
hooks:
- id: ruff
args:
- "--exit-non-zero-on-fix"

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.2.1
rev: v8.3.0
hooks:
- id: cspell
name: Spell check with cspell
Expand Down Expand Up @@ -94,7 +94,7 @@ repos:
- id: check-json5

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.38.0
rev: v0.39.0
hooks:
- id: markdownlint
exclude: >
Expand Down Expand Up @@ -135,7 +135,7 @@ repos:
types: [file, yaml]

- repo: https://github.com/PyCQA/flake8.git
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
language_version: python3
Expand Down
1 change: 1 addition & 0 deletions docs/_ext/regenerate_docs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Scripts that generates documentation from the settings definitions."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This makes it possible to invoke CLI
via :command:`python -m ansible_navigator`.
"""

from .cli import main


Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/_version_doc_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
application version, although keeping the major in sync is probably
not a bad idea to minimize the amount of stale docs in the user's cache
"""

__version_collection_doc_cache__ = "1.0"
1 change: 1 addition & 0 deletions src/ansible_navigator/action_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base class for apps (actions)."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
is identified in the
:class:`~ansible_navigator.configuration_subsystem.navigator_configuration.Internals`.
"""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/_actions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Helper functions for the ``actions`` package."""

from __future__ import annotations

import functools
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/back.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Additionally triggered by the escape key.
"""

import logging

from ansible_navigator.app_public import AppPublic
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Importing this module registers this subcommand in the external
global subcommand registry.
"""

from __future__ import annotations

import os
Expand Down
7 changes: 4 additions & 3 deletions src/ansible_navigator/actions/collections.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collections subcommand implementation."""

from __future__ import annotations

import curses
Expand Down Expand Up @@ -390,9 +391,9 @@ def _run_runner(self) -> None:
f":{ee_navigator_utils_mount}",
)
else:
set_environment_variable[
"PYTHONPATH"
] = f"${{PYTHONPATH}}:{ee_navigator_utils_mount}"
set_environment_variable["PYTHONPATH"] = (
f"${{PYTHONPATH}}:{ee_navigator_utils_mount}"
)
self._logger.debug(
"Execution Environment's PYTHONPATH is set to: %s",
set_environment_variable["PYTHONPATH"],
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config subcommand implementation."""

from __future__ import annotations

import curses
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/exec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run the :exec subcommand."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/filter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:filter`` command implementation."""

import logging

from ansible_navigator.app_public import AppPublic
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/images.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Images subcommand implementation."""

from __future__ import annotations

import curses
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/inventory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Inventory subcommand implementation."""

from __future__ import annotations

import glob
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:log`` command implementation."""

from ansible_navigator.action_base import ActionBase
from ansible_navigator.app_public import AppPublic
from ansible_navigator.configuration_subsystem.definitions import ApplicationConfiguration
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/open_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:open`` command implementation."""

from __future__ import annotations

import curses
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/quit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:quit`` command implementation."""

import logging

from ansible_navigator.app_public import AppPublic
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/refresh.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Screen refresh implementation."""

import logging

from ansible_navigator.app_public import AppPublic
Expand Down
1 change: 0 additions & 1 deletion src/ansible_navigator/actions/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
to put the kegex.
"""


from . import _actions as actions
from .run import Action as BaseAction

Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/rerun.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:rerun`` command implementation."""

import copy
import logging

Expand Down
3 changes: 2 additions & 1 deletion src/ansible_navigator/actions/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run subcommand implementation."""

from __future__ import annotations

import curses
Expand Down Expand Up @@ -644,7 +645,7 @@ def _handle_message(self, message: dict) -> None:
:type message: dict
"""
# Collect any stdout
if "stdout" in message and message["stdout"]:
if message.get("stdout"):
self.stdout.extend(message["stdout"].splitlines())
if self.mode == "stdout_w_artifact":
print(message["stdout"])
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/sample_form.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:sample_form`` command implementation."""

from ansible_navigator.action_base import ActionBase
from ansible_navigator.app_public import AppPublic
from ansible_navigator.configuration_subsystem.definitions import ApplicationConfiguration
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/save.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:save`` command implementation."""

import logging

from ansible_navigator.app_public import AppPublic
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/serialize_json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:json`` command implementation."""

import logging

from ansible_navigator.app_public import AppPublic
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/serialize_yaml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:yaml`` command implementation."""

import logging

from ansible_navigator.app_public import AppPublic
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The ``settings`` subcommand action."""

from __future__ import annotations

from dataclasses import asdict
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Processor of a template request at the single line prompt. e.g. {{ }}
"""

from __future__ import annotations

import html
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/actions/write_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""``:write`` command implementation."""

import logging
import os
import re
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/app_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This will be shared with other actions and is immutable.
"""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/command_runner/command_runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Definitions for the command runner."""

from __future__ import annotations

import multiprocessing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration definitions."""

from __future__ import annotations

import copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The ansible-navigator configuration."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/configuration_subsystem/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Build the argument parser."""

from __future__ import annotations

from argparse import SUPPRESS
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/configuration_subsystem/transform.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Methods of transforming the settings."""

from __future__ import annotations

import json
Expand Down
3 changes: 2 additions & 1 deletion src/ansible_navigator/configuration_subsystem/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities related to the configuration subsystem."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -70,7 +71,7 @@ def ansible_verison_parser(command: Command):
class AnsibleConfiguration:
"""Data structure for an ansible.cfg file."""

contents: (Constants | dict[str, dict[str, bool | int | float | str]]) = Constants.NOT_SET
contents: Constants | dict[str, dict[str, bool | int | float | str]] = Constants.NOT_SET
"""The parsed contents of the file"""
text: Constants | list[str] = Constants.NOT_SET
"""The text from the file"""
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for ansible-navigator."""

import importlib.resources as importlib_resources

from ansible_navigator.utils.compatibility import Traversable
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/content_defs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Definitions of UI content objects."""

from __future__ import annotations

from collections.abc import Sequence
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/data/image_introspect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Introspect an execution environment image."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Produce a diagnostics report in json format."""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/image_manager/inspector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Definitions for image inspection."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/image_manager/introspector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""An image introspector."""

from __future__ import annotations

import inspect
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/image_manager/puller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Image puller."""

from __future__ import annotations

import logging
Expand Down
3 changes: 2 additions & 1 deletion src/ansible_navigator/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
These helpers are specific to ansible_navigator.
"""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -123,7 +124,7 @@ def get_and_check_collection_doc_cache(
return messages, exit_messages, None

collection_cache: KeyValueStore = KeyValueStore(collection_doc_cache_path)
cache_version = collection_cache["version"] if "version" in collection_cache else None
cache_version = collection_cache.get("version", None)
message = f"Collection doc cache: 'current version' is '{cache_version}'"
messages.append(LogMessage(level=logging.DEBUG, message=message))
if cache_version is None or cache_version != VERSION_CDC:
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Logging initialization."""

from __future__ import annotations

import datetime
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/runner/ansible_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Herein lies the ability for ansible-runner to run the ansible-config command."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/runner/command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Herein lies the ability to have ansible-runner run a command in a synchronous manner."""

from __future__ import annotations

from ansible_runner import run_command
Expand Down
1 change: 1 addition & 0 deletions src/ansible_navigator/steps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Step abstractions for actions."""

from __future__ import annotations

from collections import deque
Expand Down
3 changes: 1 addition & 2 deletions src/ansible_navigator/tm_tokenize/fchainmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@


class Indexable(Generic[TKey_contra, TValue_co], Protocol):
def __getitem__(self, key: TKey_contra) -> TValue_co:
...
def __getitem__(self, key: TKey_contra) -> TValue_co: ...


class FChainMap(Generic[TKey_contra, TValue_co]):
Expand Down
Loading

0 comments on commit ba3cdfc

Please sign in to comment.