Skip to content

Commit

Permalink
Remove deprecated plugins for catkin discovery, print json reporting,…
Browse files Browse the repository at this point in the history
… and show tool output argument. (sscpac#359)
  • Loading branch information
tdenewiler authored May 17, 2021
1 parent 43e62f9 commit 1dc387d
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 314 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@ jobs:
sudo npm install -g [email protected]
rm nodesource_setup.sh
# The --allow-untyped-decorators flag is only used while we are using the `deprecated` module.
# When the deprecations are removed we can remove that mypy flag as well.
- name: Test with mypy
run: |
mypy --ignore-missing-imports --allow-untyped-decorators --strict statick statick_tool/
mypy --ignore-missing-imports --strict statick statick_tool/
- name: Test with black
if: matrix.python-version >= 3.6
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ types of reports that can be viewed with a text editor or web browser.
```shell
python3 -m pip install mypy
mkdir report
mypy --ignore-missing-imports --strict --allow-untyped-decorators --html-report report/ --txt-report report statick statick_tool/
mypy --ignore-missing-imports --strict --html-report report/ --txt-report report statick statick_tool/
```

It is hoped that in the future we will generate coverage reports from mypy and use those to check for regressions.
Expand Down
8 changes: 0 additions & 8 deletions docs/source/statick_tool.plugins.discovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ Module contents
Submodules
----------

statick_tool.plugins.discovery.catkin_discovery_plugin module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: statick_tool.plugins.discovery.catkin_discovery_plugin
:members:
:undoc-members:
:show-inheritance:

statick_tool.plugins.discovery.c_discovery_plugin module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
8 changes: 0 additions & 8 deletions docs/source/statick_tool.plugins.reporting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ statick_tool.plugins.reporting.json_reporting_plugin module
:undoc-members:
:show-inheritance:

statick_tool.plugins.reporting.print_json_reporting_plugin module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: statick_tool.plugins.reporting.print_json_reporting_plugin
:members:
:undoc-members:
:show-inheritance:

statick_tool.plugins.reporting.print_to_console_reporting_plugin module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ bandit
black
cmakelint
cpplint
deprecated
docformatter
flawfinder
lizard
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

TEST_DEPS = [
"backports.tempfile",
"deprecated",
"pylint-django",
"pytest",
"mock",
Expand Down Expand Up @@ -48,7 +47,6 @@
"bandit",
"cmakelint",
"cpplint",
"deprecated",
"flawfinder",
"lizard",
"pycodestyle",
Expand Down
35 changes: 0 additions & 35 deletions statick_tool/plugins/discovery/catkin_discovery_plugin.py

This file was deleted.

This file was deleted.

53 changes: 0 additions & 53 deletions statick_tool/plugins/reporting/print_json_reporting_plugin.py

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions statick_tool/statick.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,11 @@ def set_logging_level(args: argparse.Namespace) -> None:
log_level = args.log_level.upper()
if log_level not in valid_levels:
log_level = "WARNING"
if args.show_tool_output:
log_level = "DEBUG"
args.log_level = log_level
logging.basicConfig(level=log_level)
logging.root.setLevel(log_level)
logging.info("Log level set to %s", args.log_level.upper())

if args.show_tool_output:
logging.warning(
"The --show-tool-output argument has been deprecated since v0.5.0."
" Use log level of DEBUG instead. The argument will be removed in v0.6."
)

def get_config(self, args: argparse.Namespace) -> None:
"""Get Statick configuration."""
base_config_filename = "config.yaml"
Expand Down Expand Up @@ -149,12 +141,6 @@ def gather_args(self, args: argparse.ArgumentParser) -> None:
help="Verbosity level of output to show (DEBUG, INFO, WARNING, ERROR"
", CRITICAL)",
)
args.add_argument(
"--show-tool-output",
dest="show_tool_output",
action="store_true",
help="Show tool output",
)
args.add_argument(
"--check",
dest="check",
Expand Down
Empty file.
Empty file.

This file was deleted.

Empty file.
Empty file.

This file was deleted.

23 changes: 0 additions & 23 deletions tests/statick/test_statick.py
Original file line number Diff line number Diff line change
Expand Up @@ -1309,26 +1309,3 @@ def test_print_logging_level_invalid():

logger = logging.getLogger()
assert logger.getEffectiveLevel() == logging.WARNING


def test_show_tool_output_deprecated(caplog):
"""Test that the deprecation warning is shown for --show-tool-output flag."""
args = Args("Statick tool")
args.parser.add_argument("--path", help="Path of package to scan")

statick = Statick(args.get_user_paths())
statick.gather_args(args.parser)
sys.argv = [
"--path",
os.path.dirname(__file__),
"--log",
"INFO",
"--show-tool-output",
]
args.output_directory = os.path.dirname(__file__)
parsed_args = args.get_args(sys.argv)
statick.set_logging_level(parsed_args)

print("caplog: {}".format(caplog.text))
output = caplog.text.splitlines()[1]
assert "The --show-tool-output argument has been deprecated since v0.5.0." in output
Loading

0 comments on commit 1dc387d

Please sign in to comment.