diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d2d52a5..82e4bfe 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -29,7 +29,7 @@ jobs: - run: poetry run isort --check-only --diff . - - run: poetry run flake8 + - run: poetry run flake8 --max-doc-length 72 - run: poetry run mypy --strict . diff --git a/Makefile b/Makefile index c21d173..adf8362 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ run: lint: ${BLACK} --check --diff --color . - ${FLAKE8} + ${FLAKE8} --max-doc-length 72 ${ISORT} --color --check-only --diff . ${MYPY} --strict . diff --git a/reviewcheck/app.py b/reviewcheck/app.py index 439b00f..6cc5add 100755 --- a/reviewcheck/app.py +++ b/reviewcheck/app.py @@ -1,7 +1,9 @@ """ -A script to show you what threads in GitLab you've forgotten to respond to. +A script to show you what threads in GitLab you've forgotten to respond +to. -You have to configure the script before running it by running reviewcheck --configure +You have to configure the script before running it by running +reviewcheck --configure. """ import json import logging @@ -276,7 +278,7 @@ def show_reviews(config: Dict[str, Any]) -> None: for comment in discussion_data: # When minimal view is requsted, only show threads where a - # response is required + # response is required. if hide_replied_discussions: if comment["notes"][-1]["author"]["username"] == user: continue diff --git a/reviewcheck/common/exceptions.py b/reviewcheck/common/exceptions.py index 5d0aac8..0b6caf9 100644 --- a/reviewcheck/common/exceptions.py +++ b/reviewcheck/common/exceptions.py @@ -1,6 +1,6 @@ class RCException(Exception): """ - Base exception to inherit from when creating custom exceptions and to use directly - when it's not necessary to differentiate excepitons. It is caught in main and will - print the message in the exceptions. + Base exception to inherit from when creating custom exceptions and + to use directly when it's not necessary to differentiate excepitons. + It is caught in main and will print the message in the exceptions. """ diff --git a/reviewcheck/config.py b/reviewcheck/config.py index 4a62244..52b507e 100644 --- a/reviewcheck/config.py +++ b/reviewcheck/config.py @@ -14,7 +14,8 @@ def __init__(self, reconfigure: bool): self.reconfigure = reconfigure def setup_configuration(self) -> None: - # Only attempt to write the configuration file if it does not already exist + # Only attempt to write the configuration file if it does not + # already exist. if self.reconfigure or not Constants.CONFIG_PATH.exists(): Constants.CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True) @@ -48,11 +49,12 @@ def setup_configuration(self) -> None: def get_configuration(self) -> Optional[Dict[str, Any]]: """ - Reads the configuration file into a dictionary. If the configuration file does - not exist, queries the user for information and writes it. + Reads the configuration file into a dictionary. If the + configuration file does not exist, queries the user for + information and writes it. - :return: A dict containing the contents of the configuration file, or None if - the file does not exist. + :return: A dict containing the contents of the configuration + file, or None if the file does not exist. """ self.setup_configuration() diff --git a/tests/test_config.py b/tests/test_config.py index 283d74a..c34c4af 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -16,10 +16,12 @@ class TestConfig(TestCase): @mock.patch("builtins.input") def test_setup_configuration(self, mock_input: mock.MagicMock) -> None: """ - Verifies that the interactive configuration setup works as expected. + Verifies that the interactive configuration setup works as + expected. """ - # The setup_configuration method reads input from the user five times in a row: + # The setup_configuration method reads input from the user five + # times in a row: # token, username, api url, jira url, and finally project IDs mock_input.side_effect = [ "very_secret", @@ -57,8 +59,8 @@ def test_setup_configuration(self, mock_input: mock.MagicMock) -> None: def test_setup_configuration_without_reconfigure(self) -> None: """ - Verifies that the configuration setup does not alter anything if the file - already exists. + Verifies that the configuration setup does not alter anything if + the file already exists. """ with tempfile.TemporaryDirectory(