From f544a53dbce2a2dcfe55eafbfed50ffe7cb4bbbb Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sat, 5 Apr 2025 03:21:21 +0200 Subject: [PATCH 1/2] fix typos discovered by codespell (#669) Co-authored-by: Tom Hu <88201630+thomasrockhu-codecov@users.noreply.github.com> --- README.md | 2 +- codecov_cli/commands/labelanalysis.py | 2 +- codecov_cli/plugins/pycoverage.py | 2 +- codecov_cli/runners/pytest_standard_runner.py | 2 +- codecov_cli/services/report/__init__.py | 2 +- .../services/staticanalysis/__init__.py | 2 +- .../analyzers/python/node_wrappers.py | 2 +- tests/helpers/test_folder_searcher.py | 2 +- tests/runners/test_pytest_standard_runner.py | 20 +++++++++---------- tests/services/report/test_report_results.py | 2 +- .../test_static_analysis_service.py | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 8be9fc3d..7aea238b 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ Codecov-cli supports user input. These inputs, along with their descriptions and | `create-report-results` | Used for local upload. It tells codecov that you finished local uploading and want it to calculate the results for you to get them locally. | `get-report-results` | Used for local upload. It asks codecov to provide you the report results you calculated with the previous command. | `pr-base-picking` | Tells codecov that you want to explicitly define a base for your PR -| `upload-process` | A wrapper for 3 commands. Create-commit, create-report and do-upload. You can use this command to upload to codecov instead of using the previosly mentioned commands. +| `upload-process` | A wrapper for 3 commands. Create-commit, create-report and do-upload. You can use this command to upload to codecov instead of using the previously mentioned commands. | `send-notifications` | A command that tells Codecov that you finished uploading and you want to be sent notifications. To disable automatically sent notifications please consider adding manual_trigger to your codecov.yml, so it will look like codecov: notify: manual_trigger: true. >**Note**: Every command has its own different options that will be mentioned later in this doc. Codecov will try to load these options from your CI environment variables, if not, it will try to load them from git, if not found, you may need to add them manually. diff --git a/codecov_cli/commands/labelanalysis.py b/codecov_cli/commands/labelanalysis.py index 6b72ac82..8f720e28 100644 --- a/codecov_cli/commands/labelanalysis.py +++ b/codecov_cli/commands/labelanalysis.py @@ -259,7 +259,7 @@ def _parse_runner_params(runner_params: List[str]) -> Dict[str, str]: # a good reason for the param to include '=' in the value. if param.count("=") == 0: logger.warning( - f"Runner param {param} is not well formated. Setting value to None. Use '--runner-param key=value' to set value" + f"Runner param {param} is not well formatted. Setting value to None. Use '--runner-param key=value' to set value" ) final_params[param] = None else: diff --git a/codecov_cli/plugins/pycoverage.py b/codecov_cli/plugins/pycoverage.py index be831833..97fcccb4 100644 --- a/codecov_cli/plugins/pycoverage.py +++ b/codecov_cli/plugins/pycoverage.py @@ -28,7 +28,7 @@ def project_root(self) -> typing.Optional[pathlib.Path]: def report_type(self) -> str: """ Report type to generate. - Overrided if include_contexts == True + Overridden if include_contexts == True report_type: str [values xml|json; default xml] """ return self.get("report_type", "xml") diff --git a/codecov_cli/runners/pytest_standard_runner.py b/codecov_cli/runners/pytest_standard_runner.py index 3d1f9a2a..0e4260dd 100644 --- a/codecov_cli/runners/pytest_standard_runner.py +++ b/codecov_cli/runners/pytest_standard_runner.py @@ -76,7 +76,7 @@ def _possibly_warn_bad_config(self, config_params: dict): provided_config_params = config_params.keys() for provided_param in provided_config_params: if provided_param not in available_config_params: - logger.warning(f"Config parameter '{provided_param}' is unknonw.") + logger.warning(f"Config parameter '{provided_param}' is unknown.") def parse_captured_output_error(self, exp: CalledProcessError) -> str: result = "" diff --git a/codecov_cli/services/report/__init__.py b/codecov_cli/services/report/__init__.py index da2b5127..757a7f47 100644 --- a/codecov_cli/services/report/__init__.py +++ b/codecov_cli/services/report/__init__.py @@ -138,7 +138,7 @@ def send_reports_result_get_request( state = response_content.get("state").lower() if state == "error": logger.error( - "An error occured while processing the report. Please try again later.", + "An error occurred while processing the report. Please try again later.", extra=dict( extra_log_attributes=dict( response_status_code=response_obj.status_code, diff --git a/codecov_cli/services/staticanalysis/__init__.py b/codecov_cli/services/staticanalysis/__init__.py index 3cde4313..16cd15fd 100644 --- a/codecov_cli/services/staticanalysis/__init__.py +++ b/codecov_cli/services/staticanalysis/__init__.py @@ -39,7 +39,7 @@ async def run_analysis_entrypoint( files = list(ff.find_files(folder, pattern, folders_to_exclude)) processing_results = await process_files(files, numberprocesses, config) # Let users know if there were processing errors - # This is here and not in the funcition so we can add an option to ignore those (possibly) + # This is here and not in the function so we can add an option to ignore those (possibly) # Also makes the function easier to test processing_errors = processing_results["processing_errors"] log_processing_errors(processing_errors) diff --git a/codecov_cli/services/staticanalysis/analyzers/python/node_wrappers.py b/codecov_cli/services/staticanalysis/analyzers/python/node_wrappers.py index f313bfb7..681eeb1a 100644 --- a/codecov_cli/services/staticanalysis/analyzers/python/node_wrappers.py +++ b/codecov_cli/services/staticanalysis/analyzers/python/node_wrappers.py @@ -16,7 +16,7 @@ def visit(self, node: Node): self.visit(c) def _is_function_docstring(self, node: Node): - """Skips docstrings for funtions, such as this one. + """Skips docstrings for functions, such as this one. Pytest doesn't include them in the report, so I don't think we should either, at least for now. """ diff --git a/tests/helpers/test_folder_searcher.py b/tests/helpers/test_folder_searcher.py index 59eeef9d..9e66908f 100644 --- a/tests/helpers/test_folder_searcher.py +++ b/tests/helpers/test_folder_searcher.py @@ -256,7 +256,7 @@ def test_search_directories(tmp_path): filename_include_regex = globs_to_regex(["*.app"]) filepaths = [ "banana.app/path/of/directory.txt", - "path/to/apple.app/path/of/directorys", + "path/to/apple.app/path/of/directories", "path/to/banana.app/folder/test.txt", "apple.py", "banana.py", diff --git a/tests/runners/test_pytest_standard_runner.py b/tests/runners/test_pytest_standard_runner.py index 489a0e0c..b13216cb 100644 --- a/tests/runners/test_pytest_standard_runner.py +++ b/tests/runners/test_pytest_standard_runner.py @@ -56,7 +56,7 @@ def test_warning_bad_config(self, mock_warning): runner = PytestStandardRunner(params) # Adding invalid config options emits a warning mock_warning.assert_called_with( - "Config parameter 'some_missing_option' is unknonw." + "Config parameter 'some_missing_option' is unknown." ) # Warnings don't change the config assert runner.params == {**params, "some_missing_option": "option"} @@ -91,7 +91,7 @@ def side_effect(command, *args, **kwargs): cmd=command, returncode=2, output=b"Process running up to here...", - stderr=b"Some error occured", + stderr=b"Some error occurred", ) mock_subprocess.run.side_effect = side_effect @@ -100,7 +100,7 @@ def side_effect(command, *args, **kwargs): _ = self.runner._execute_pytest(["--option", "--ignore=batata"]) assert ( str(exp.value) - == "Pytest exited with non-zero code 2.\nThis is likely not a problem with label-analysis. Check pytest's output and options.\nPYTEST OUTPUT:\nProcess running up to here...\nSome error occured" + == "Pytest exited with non-zero code 2.\nThis is likely not a problem with label-analysis. Check pytest's output and options.\nPYTEST OUTPUT:\nProcess running up to here...\nSome error occurred" ) @patch("codecov_cli.runners.pytest_standard_runner.subprocess") @@ -112,7 +112,7 @@ def side_effect(command, *args, **kwargs): raise CalledProcessError( cmd=command, returncode=2, - stderr=b"Some error occured", + stderr=b"Some error occurred", ) mock_subprocess.run.side_effect = side_effect @@ -134,26 +134,26 @@ def side_effect(command, *args, **kwargs): cmd=["python", "-m", "pytest", "missing_label"], returncode=2, output=b"Process running up to here...", - stderr=b"Some error occured", + stderr=b"Some error occurred", ), - "\nProcess running up to here...\nSome error occured", + "\nProcess running up to here...\nSome error occurred", ), ( CalledProcessError( cmd=["python", "-m", "pytest", "missing_label"], returncode=2, output="Process running up to here...", - stderr="Some error occured", + stderr="Some error occurred", ), - "\nProcess running up to here...\nSome error occured", + "\nProcess running up to here...\nSome error occurred", ), ( CalledProcessError( cmd=["python", "-m", "pytest", "missing_label"], returncode=2, - stderr=b"Some error occured", + stderr=b"Some error occurred", ), - "\nSome error occured", + "\nSome error occurred", ), ], ) diff --git a/tests/services/report/test_report_results.py b/tests/services/report/test_report_results.py index f713ce6b..0e3d3ad6 100644 --- a/tests/services/report/test_report_results.py +++ b/tests/services/report/test_report_results.py @@ -215,7 +215,7 @@ def test_get_report_results_200_error(mocker, capsys): mocked_response.assert_called_once() assert ( "error", - 'An error occured while processing the report. Please try again later. --- {"response_status_code": 200, "state": "error", "result": {}}', + 'An error occurred while processing the report. Please try again later. --- {"response_status_code": 200, "state": "error", "result": {}}', ) in output diff --git a/tests/services/static_analysis/test_static_analysis_service.py b/tests/services/static_analysis/test_static_analysis_service.py index 635eecf9..461ed684 100644 --- a/tests/services/static_analysis/test_static_analysis_service.py +++ b/tests/services/static_analysis/test_static_analysis_service.py @@ -286,7 +286,7 @@ async def test_send_single_upload_put_fail_exception(self, mocker): async def side_effect(presigned_put, data): if presigned_put == "http://storage-url-003": - raise httpx.HTTPError("Some error occured in the request") + raise httpx.HTTPError("Some error occurred in the request") mock_client.put.side_effect = side_effect From e9bcffdeb307b9bab862a712513229ad27a9cd79 Mon Sep 17 00:00:00 2001 From: Codecov Releaser Date: Mon, 7 Apr 2025 22:48:17 -0400 Subject: [PATCH 2/2] Prepare release 10.4.0 (#676) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1962a402..d1b9a228 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ license = {file = "LICENSE"} name = "codecov-cli" readme = "README.md" requires-python = ">= 3.9" -version = "10.3.0" +version = "10.4.0" [project.scripts] codecov = "codecov_cli.main:run"