ansible-test - Code style cleanup (#84749)

* ansible-test - Minor style cleanup (add blank lines)

* ansible-test - Use `"""` instead of `'''`
pull/83569/merge
Matt Clay 9 months ago committed by GitHub
parent e9e6001263
commit 5ff8d093f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,4 +1,5 @@
"""Test runner for all Ansible tests."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Miscellaneous utility functions and classes specific to ansible cli tools."""
from __future__ import annotations
import json

@ -1,4 +1,5 @@
"""Become abstraction for interacting with test hosts."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""Bootstrapping for test hosts."""
from __future__ import annotations
import dataclasses

@ -1,4 +1,5 @@
"""Cache for commonly shared data that is intended to be immutable."""
from __future__ import annotations
import collections.abc as c

@ -1,4 +1,5 @@
"""Linux control group constants, classes and utilities."""
from __future__ import annotations
import codecs

@ -1,4 +1,5 @@
"""Support code for CI environments."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""Support code for working with Azure Pipelines."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Support code for working without a supported CI provider."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Classify changes in Ansible code."""
from __future__ import annotations
import collections

@ -1,4 +1,5 @@
"""Common classification code used by multiple languages."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Analyze C# import statements."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Analyze powershell import statements."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Analyze python import statements."""
from __future__ import annotations
import ast

@ -1,4 +1,5 @@
"""Command line parsing."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Actions for handling composite arguments with argparse."""
from __future__ import annotations
from .argparsing import (

@ -1,4 +1,5 @@
"""Completion finder which brings together custom options and completion logic."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""Actions for argparse."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Wrapper around argcomplete providing bug fixes and additional features."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""General purpose composite argument parsing and completion."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""Command line parsing for all commands."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for all `coverage` commands."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for all `coverage analyze` commands."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for all `coverage analyze targets` commands."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage analyze targets combine` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage analyze targets expand` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage analyze targets filter` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage analyze targets generate` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage analyze targets missing` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage combine` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage erase` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage html` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage report` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `coverage xml` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `env` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for all integration commands."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `network-integration` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `integration` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `windows-integration` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `sanity` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `shell` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for the `units` command."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Provides compatibility with first-generation host delegation options in ansible-test."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Completers for use with argcomplete."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Converters for use as the type argument for arparse's add_argument method."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Command line parsing for test environments."""
from __future__ import annotations
import argparse

@ -1,4 +1,5 @@
"""Argument parsing epilog generation."""
from __future__ import annotations
from .argparsing import (

@ -1,4 +1,5 @@
"""Composite argument parsers for ansible-test specific command-line arguments."""
from __future__ import annotations
import typing as t

@ -1,4 +1,5 @@
"""Base classes for the primary parsers for composite command line arguments."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""Helper functions for composite parsers."""
from __future__ import annotations
from ...constants import (

@ -1,4 +1,5 @@
"""Composite parsers for the various types of hosts."""
from __future__ import annotations
import typing as t

@ -1,4 +1,5 @@
"""Composite argument key-value parsers used by other parsers."""
from __future__ import annotations
import typing as t

@ -1,4 +1,5 @@
"""Composite argument value parsers used by other parsers."""
from __future__ import annotations
import collections.abc as c

@ -1,2 +1,3 @@
"""Nearly empty __init__.py to keep pylint happy."""
from __future__ import annotations

@ -1,4 +1,5 @@
"""Common logic for the coverage subcommand."""
from __future__ import annotations
import collections.abc as c
@ -226,7 +227,7 @@ def read_python_coverage_legacy(path: str) -> PythonArcs:
"""Return coverage arcs from the specified coverage file, which must be in the legacy JSON format."""
try:
contents = read_text_file(path)
contents = re.sub(r'''^!coverage.py: This is a private format, don't read it directly!''', '', contents)
contents = re.sub(r"""^!coverage.py: This is a private format, don't read it directly!""", '', contents)
data = json.loads(contents)
arcs: PythonArcs = {filename: [t.cast(tuple[int, int], tuple(arc)) for arc in arc_list] for filename, arc_list in data['arcs'].items()}
except Exception as ex:

@ -1,4 +1,5 @@
"""Common logic for the `coverage analyze` subcommand."""
from __future__ import annotations
import typing as t

@ -1,4 +1,5 @@
"""Analyze integration test target code coverage."""
from __future__ import annotations
import collections.abc as c

@ -1,4 +1,5 @@
"""Combine integration test target code coverage reports."""
from __future__ import annotations
import typing as t

@ -1,4 +1,5 @@
"""Expand target names in an aggregated coverage file."""
from __future__ import annotations
import typing as t

@ -1,4 +1,5 @@
"""Filter an aggregated coverage file, keeping only the specified targets."""
from __future__ import annotations
import collections.abc as c

@ -1,4 +1,5 @@
"""Analyze code coverage data to determine which integration test targets provide coverage for each arc or line."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Identify aggregated coverage in one file missing from another."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Combine code coverage files."""
from __future__ import annotations
import collections.abc as c

@ -1,4 +1,5 @@
"""Erase code coverage files."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Generate HTML code coverage reports."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Generate console code coverage reports."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Generate XML code coverage reports."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Show information about the test environment."""
from __future__ import annotations
import datetime
@ -49,6 +50,7 @@ from ...timeout import (
class EnvConfig(CommonConfig):
"""Configuration for the `env` command."""
def __init__(self, args: t.Any) -> None:
super().__init__(args, 'env')

@ -1,4 +1,5 @@
"""Ansible integration test infrastructure."""
from __future__ import annotations
import collections.abc as c

@ -1,4 +1,5 @@
"""Plugin system for cloud providers and environments for use in integration tests."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""ACME plugin for integration tests."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""AWS plugin for integration tests."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Azure plugin for integration tests."""
from __future__ import annotations
import configparser

@ -1,4 +1,5 @@
"""CloudStack plugin for integration tests."""
from __future__ import annotations
import json

@ -1,4 +1,5 @@
"""DigitalOcean plugin for integration tests."""
from __future__ import annotations
import configparser

@ -1,4 +1,5 @@
"""Galaxy (ansible-galaxy) plugin for integration tests."""
from __future__ import annotations
import os
@ -69,7 +70,7 @@ SETTINGS = {
}
GALAXY_IMPORTER = b'''
GALAXY_IMPORTER = b"""
[galaxy-importer]
ansible_local_tmp=~/.ansible/tmp
ansible_test_local_image=false
@ -84,7 +85,7 @@ run_ansible_doc=false
run_ansible_lint=false
run_ansible_test=false
run_flake8=false
'''.strip()
""".strip()
class GalaxyProvider(CloudProvider):

@ -1,4 +1,5 @@
"""Hetzner Cloud plugin for integration tests."""
from __future__ import annotations
import configparser

@ -1,4 +1,5 @@
"""HTTP Tester plugin for integration tests."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""NIOS plugin for integration tests."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""OpenNebula plugin for integration tests."""
from __future__ import annotations
import configparser

@ -1,4 +1,5 @@
"""OpenShift plugin for integration tests."""
from __future__ import annotations
import re

@ -1,4 +1,5 @@
"""Scaleway plugin for integration tests."""
from __future__ import annotations
import configparser

@ -1,4 +1,5 @@
"""VMware vCenter plugin for integration tests."""
from __future__ import annotations
import configparser

@ -1,4 +1,5 @@
"""Vultr plugin for integration tests."""
from __future__ import annotations
import configparser

@ -1,4 +1,5 @@
"""Code coverage support for integration tests."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""Logic for filtering out integration test targets which are unsupported for the currently provided arguments and available hosts."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""Network integration testing."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""POSIX integration testing."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Windows integration testing."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Execute Ansible sanity tests."""
from __future__ import annotations
import abc

@ -1,4 +1,5 @@
"""Sanity test for ansible-doc."""
from __future__ import annotations
import collections

@ -1,4 +1,5 @@
"""Sanity test for symlinks in the bin directory."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Sanity test for proper python syntax."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Sanity test for the sanity ignore file."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Sanity test for proper import exception handling."""
from __future__ import annotations
import collections.abc as c

@ -1,4 +1,5 @@
"""Sanity test to check integration test aliases."""
from __future__ import annotations
import dataclasses

@ -1,4 +1,5 @@
"""Sanity test for PEP 8 style guidelines using pycodestyle."""
from __future__ import annotations
import os

@ -1,4 +1,5 @@
"""Sanity test using PSScriptAnalyzer."""
from __future__ import annotations
import json

@ -1,4 +1,5 @@
"""Sanity test using pylint."""
from __future__ import annotations
import collections.abc as c

@ -1,4 +1,5 @@
"""Sanity test using shellcheck."""
from __future__ import annotations
import os

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save