codecov-cli 0.5.2__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. {codecov-cli-0.5.2/codecov_cli.egg-info → codecov-cli-0.6.0}/PKG-INFO +1 -1
  2. codecov-cli-0.6.0/codecov_cli/commands/process_test_results.py +175 -0
  3. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/folder_searcher.py +1 -1
  4. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/git.py +4 -1
  5. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/git_services/github.py +5 -3
  6. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/versioning_systems.py +5 -3
  7. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/main.py +2 -0
  8. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/analyzers/general.py +2 -2
  9. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/upload/file_finder.py +5 -1
  10. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/upload/upload_collector.py +4 -2
  11. {codecov-cli-0.5.2 → codecov-cli-0.6.0/codecov_cli.egg-info}/PKG-INFO +1 -1
  12. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli.egg-info/SOURCES.txt +1 -0
  13. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli.egg-info/requires.txt +2 -0
  14. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/setup.py +3 -1
  15. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/LICENSE +0 -0
  16. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/MANIFEST.in +0 -0
  17. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/README.md +0 -0
  18. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/__init__.py +0 -0
  19. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/__init__.py +0 -0
  20. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/base_picking.py +0 -0
  21. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/commit.py +0 -0
  22. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/create_report_result.py +0 -0
  23. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/empty_upload.py +0 -0
  24. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/get_report_results.py +0 -0
  25. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/labelanalysis.py +0 -0
  26. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/report.py +0 -0
  27. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/send_notifications.py +0 -0
  28. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/staticanalysis.py +0 -0
  29. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/upload.py +0 -0
  30. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/commands/upload_process.py +0 -0
  31. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/fallbacks.py +0 -0
  32. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/__init__.py +0 -0
  33. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/__init__.py +0 -0
  34. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/appveyor_ci.py +0 -0
  35. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/azure_pipelines.py +0 -0
  36. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/base.py +0 -0
  37. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/bitbucket_ci.py +0 -0
  38. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/bitrise_ci.py +0 -0
  39. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/buildkite.py +0 -0
  40. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/circleci.py +0 -0
  41. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/cirrus_ci.py +0 -0
  42. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/codebuild.py +0 -0
  43. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/droneci.py +0 -0
  44. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/github_actions.py +0 -0
  45. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/gitlab_ci.py +0 -0
  46. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/heroku.py +0 -0
  47. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/jenkins.py +0 -0
  48. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/local.py +0 -0
  49. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/teamcity.py +0 -0
  50. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/travis_ci.py +0 -0
  51. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/ci_adapters/woodpeckerci.py +0 -0
  52. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/config.py +0 -0
  53. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/encoder.py +0 -0
  54. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/git_services/__init__.py +0 -0
  55. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/logging_utils.py +0 -0
  56. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/options.py +0 -0
  57. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/request.py +0 -0
  58. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/helpers/validators.py +0 -0
  59. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/plugins/__init__.py +0 -0
  60. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/plugins/compress_pycoverage_contexts.py +0 -0
  61. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/plugins/gcov.py +0 -0
  62. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/plugins/pycoverage.py +0 -0
  63. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/plugins/types.py +0 -0
  64. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/plugins/xcode.py +0 -0
  65. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/runners/__init__.py +0 -0
  66. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/runners/dan_runner.py +0 -0
  67. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/runners/pytest_standard_runner.py +0 -0
  68. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/runners/types.py +0 -0
  69. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/__init__.py +0 -0
  70. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/commit/__init__.py +0 -0
  71. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/commit/base_picking.py +0 -0
  72. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/empty_upload/__init__.py +0 -0
  73. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/report/__init__.py +0 -0
  74. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/__init__.py +0 -0
  75. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/analyzers/__init__.py +0 -0
  76. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/analyzers/javascript_es6/__init__.py +0 -0
  77. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/analyzers/javascript_es6/node_wrappers.py +0 -0
  78. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/analyzers/python/__init__.py +0 -0
  79. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/analyzers/python/node_wrappers.py +0 -0
  80. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/exceptions.py +0 -0
  81. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/finders.py +0 -0
  82. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/staticanalysis/types.py +0 -0
  83. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/upload/__init__.py +0 -0
  84. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/upload/legacy_upload_sender.py +0 -0
  85. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/upload/network_finder.py +0 -0
  86. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/upload/upload_sender.py +0 -0
  87. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/services/upload_completion/__init__.py +0 -0
  88. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli/types.py +0 -0
  89. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli.egg-info/dependency_links.txt +0 -0
  90. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli.egg-info/entry_points.txt +0 -0
  91. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/codecov_cli.egg-info/top_level.txt +0 -0
  92. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/languages/languages.c +0 -0
  93. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/languages/treesitterjavascript/src/parser.c +0 -0
  94. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/languages/treesitterjavascript/src/scanner.c +0 -0
  95. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/languages/treesitterjavascript/src/tree_sitter/parser.h +0 -0
  96. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/languages/treesitterpython/src/parser.c +0 -0
  97. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/languages/treesitterpython/src/scanner.cc +0 -0
  98. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/languages/treesitterpython/src/tree_sitter/parser.h +0 -0
  99. {codecov-cli-0.5.2 → codecov-cli-0.6.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codecov-cli
3
- Version: 0.5.2
3
+ Version: 0.6.0
4
4
  Summary: Codecov Command Line Interface
5
5
  Author: Codecov
6
6
  Author-email: support@codecov.io
@@ -0,0 +1,175 @@
1
+ import logging
2
+ import os
3
+ import pathlib
4
+ from dataclasses import dataclass
5
+ from typing import List
6
+
7
+ import click
8
+ from test_results_parser import (
9
+ Outcome,
10
+ ParserError,
11
+ Testrun,
12
+ build_message,
13
+ parse_junit_xml,
14
+ )
15
+
16
+ from codecov_cli.helpers.request import (
17
+ log_warnings_and_errors_if_any,
18
+ send_post_request,
19
+ )
20
+ from codecov_cli.services.upload.file_finder import select_file_finder
21
+
22
+ logger = logging.getLogger("codecovcli")
23
+
24
+
25
+ _process_test_results_options = [
26
+ click.option(
27
+ "-s",
28
+ "--dir",
29
+ "--files-search-root-folder",
30
+ "dir",
31
+ help="Folder where to search for test results files",
32
+ type=click.Path(path_type=pathlib.Path),
33
+ default=pathlib.Path.cwd,
34
+ show_default="Current Working Directory",
35
+ ),
36
+ click.option(
37
+ "-f",
38
+ "--file",
39
+ "--files-search-direct-file",
40
+ "files",
41
+ help="Explicit files to upload. These will be added to the test results files to be processed. If you wish to only process the specified files, please consider using --disable-search to disable processing other files.",
42
+ type=click.Path(path_type=pathlib.Path),
43
+ multiple=True,
44
+ default=[],
45
+ ),
46
+ click.option(
47
+ "--exclude",
48
+ "--files-search-exclude-folder",
49
+ "exclude_folders",
50
+ help="Folders to exclude from search",
51
+ type=click.Path(path_type=pathlib.Path),
52
+ multiple=True,
53
+ default=[],
54
+ ),
55
+ click.option(
56
+ "--disable-search",
57
+ help="Disable search for coverage files. This is helpful when specifying what files you want to upload with the --file option.",
58
+ is_flag=True,
59
+ default=False,
60
+ ),
61
+ click.option(
62
+ "--provider-token",
63
+ help="Token used to make calls to Repo provider API",
64
+ type=str,
65
+ default=None,
66
+ ),
67
+ ]
68
+
69
+
70
+ def process_test_results_options(func):
71
+ for option in reversed(_process_test_results_options):
72
+ func = option(func)
73
+ return func
74
+
75
+
76
+ @dataclass
77
+ class TestResultsNotificationPayload:
78
+ failures: List[Testrun]
79
+ failed: int = 0
80
+ passed: int = 0
81
+ skipped: int = 0
82
+
83
+
84
+ @click.command()
85
+ @process_test_results_options
86
+ def process_test_results(
87
+ dir=None, files=None, exclude_folders=None, disable_search=None, provider_token=None
88
+ ):
89
+ if provider_token is None:
90
+ raise click.ClickException(
91
+ "Provider token was not provided. Make sure to pass --provider-token option with the contents of the GITHUB_TOKEN secret, so we can make a comment."
92
+ )
93
+
94
+ summary_file_path = os.getenv("GITHUB_STEP_SUMMARY")
95
+ if summary_file_path is None:
96
+ raise click.ClickException(
97
+ "Error getting step summary file path from environment. Can't find GITHUB_STEP_SUMMARY environment variable."
98
+ )
99
+
100
+ slug = os.getenv("GITHUB_REPOSITORY")
101
+ if slug is None:
102
+ raise click.ClickException(
103
+ "Error getting repo slug from environment. Can't find GITHUB_REPOSITORY environment variable."
104
+ )
105
+
106
+ ref = os.getenv("GITHUB_REF")
107
+ if ref is None or "pull" not in ref:
108
+ raise click.ClickException(
109
+ "Error getting PR number from environment. Can't find GITHUB_REF environment variable."
110
+ )
111
+
112
+ file_finder = select_file_finder(
113
+ dir, exclude_folders, files, disable_search, report_type="test_results"
114
+ )
115
+
116
+ upload_collection_results = file_finder.find_files()
117
+ if len(upload_collection_results) == 0:
118
+ raise click.ClickException(
119
+ "No JUnit XML files were found. Make sure to specify them using the --file option."
120
+ )
121
+
122
+ payload = generate_message_payload(upload_collection_results)
123
+
124
+ message = build_message(payload)
125
+
126
+ # write to step summary file
127
+ with open(summary_file_path, "w") as f:
128
+ f.write(message)
129
+
130
+ # GITHUB_REF is documented here: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
131
+ pr_number = ref.split("/")[2]
132
+
133
+ create_github_comment(provider_token, slug, pr_number, message)
134
+
135
+
136
+ def create_github_comment(token, repo_slug, pr_number, message):
137
+ url = f"https://api.github.com/repos/{repo_slug}/issues/{pr_number}/comments"
138
+
139
+ headers = {
140
+ "Accept": "application/vnd.github+json",
141
+ "Authorization": f"Bearer {token}",
142
+ "X-GitHub-Api-Version": "2022-11-28",
143
+ }
144
+ logger.info("Posting github comment")
145
+
146
+ log_warnings_and_errors_if_any(
147
+ send_post_request(url=url, data={"body": message}, headers=headers),
148
+ "Posting test results comment",
149
+ )
150
+
151
+
152
+ def generate_message_payload(upload_collection_results):
153
+ payload = TestResultsNotificationPayload(failures=[])
154
+
155
+ for result in upload_collection_results:
156
+ testruns = []
157
+ try:
158
+ logger.info(f"Parsing {result.get_filename()}")
159
+ testruns = parse_junit_xml(result.get_content())
160
+ for testrun in testruns:
161
+ if (
162
+ testrun.outcome == Outcome.Failure
163
+ or testrun.outcome == Outcome.Error
164
+ ):
165
+ payload.failed += 1
166
+ payload.failures.append(testrun)
167
+ elif testrun.outcome == Outcome.Skip:
168
+ payload.skipped += 1
169
+ else:
170
+ payload.passed += 1
171
+ except ParserError as err:
172
+ raise click.ClickException(
173
+ f"Error parsing {str(result.get_filename(), 'utf8')} with error: {err}"
174
+ )
175
+ return payload
@@ -58,7 +58,7 @@ def search_files(
58
58
  this_is_excluded = functools.partial(
59
59
  _is_excluded, filename_exclude_regex, multipart_exclude_regex
60
60
  )
61
- for (dirpath, dirnames, filenames) in os.walk(folder_to_search):
61
+ for dirpath, dirnames, filenames in os.walk(folder_to_search):
62
62
  dirs_to_remove = set(d for d in dirnames if d in folders_to_ignore)
63
63
 
64
64
  if multipart_exclude_regex is not None:
@@ -61,13 +61,16 @@ def parse_git_service(remote_repo_url: str):
61
61
  Possible cases we're considering:
62
62
  - https://github.com/codecov/codecov-cli.git returns github
63
63
  - git@github.com:codecov/codecov-cli.git returns github
64
+ - ssh://git@github.com/gitcodecov/codecov-cli returns github
65
+ - ssh://git@github.com:gitcodecov/codecov-cli returns github
64
66
  - https://user-name@bitbucket.org/namespace-codecov/first_repo.git returns bitbucket
65
67
  """
66
68
  services = [service.value for service in GitService]
67
69
  parsed_url = urlparse(remote_repo_url)
68
70
  service = None
69
71
 
70
- if remote_repo_url.startswith("https://"):
72
+ scheme = parsed_url.scheme
73
+ if scheme in ("https", "ssh"):
71
74
  netloc = parsed_url.netloc
72
75
  if "@" in netloc:
73
76
  netloc = netloc.split("@", 1)[1]
@@ -24,9 +24,11 @@ class Github:
24
24
  "ref": res["head"]["ref"],
25
25
  # Through empiric test data it seems that the "repo" key in "head" is set to None
26
26
  # If the PR is from the same repo (e.g. not from a fork)
27
- "slug": res["head"]["repo"]["full_name"]
28
- if res["head"]["repo"]
29
- else res["base"]["repo"]["full_name"],
27
+ "slug": (
28
+ res["head"]["repo"]["full_name"]
29
+ if res["head"]["repo"]
30
+ else res["base"]["repo"]["full_name"]
31
+ ),
30
32
  },
31
33
  "base": {
32
34
  "sha": res["base"]["sha"],
@@ -135,9 +135,11 @@ class GitVersioningSystem(VersioningSystemInterface):
135
135
  )
136
136
 
137
137
  return [
138
- filename[1:-1]
139
- if filename.startswith('"') and filename.endswith('"')
140
- else filename
138
+ (
139
+ filename[1:-1]
140
+ if filename.startswith('"') and filename.endswith('"')
141
+ else filename
142
+ )
141
143
  for filename in res.stdout.decode("unicode_escape").strip().split("\n")
142
144
  ]
143
145
 
@@ -11,6 +11,7 @@ from codecov_cli.commands.create_report_result import create_report_results
11
11
  from codecov_cli.commands.empty_upload import empty_upload
12
12
  from codecov_cli.commands.get_report_results import get_report_results
13
13
  from codecov_cli.commands.labelanalysis import label_analysis
14
+ from codecov_cli.commands.process_test_results import process_test_results
14
15
  from codecov_cli.commands.report import create_report
15
16
  from codecov_cli.commands.send_notifications import send_notifications
16
17
  from codecov_cli.commands.staticanalysis import static_analysis
@@ -71,6 +72,7 @@ cli.add_command(static_analysis)
71
72
  cli.add_command(empty_upload)
72
73
  cli.add_command(upload_process)
73
74
  cli.add_command(send_notifications)
75
+ cli.add_command(process_test_results)
74
76
 
75
77
 
76
78
  def run():
@@ -85,13 +85,13 @@ class BaseAnalyzer(object):
85
85
 
86
86
  def get_import_lines(self, root_node, imports_query):
87
87
  import_lines = set()
88
- for (a, _) in imports_query.captures(root_node):
88
+ for a, _ in imports_query.captures(root_node):
89
89
  import_lines.add((a.start_point[0] + 1, a.end_point[0] - a.start_point[0]))
90
90
  return import_lines
91
91
 
92
92
  def get_definition_lines(self, root_node, definitions_query):
93
93
  definition_lines = set()
94
- for (a, _) in definitions_query.captures(root_node):
94
+ for a, _ in definitions_query.captures(root_node):
95
95
  definition_lines.add(
96
96
  (a.start_point[0] + 1, a.end_point[0] - a.start_point[0])
97
97
  )
@@ -253,7 +253,11 @@ class FileFinder(object):
253
253
  user_files_paths_resolved = [path.resolve() for path in user_files_paths]
254
254
  for filepath in self.explicitly_listed_files:
255
255
  if filepath.resolve() not in user_files_paths_resolved:
256
- not_found_files.append(filepath)
256
+ ## The file given might be linked or in a parent dir, check to see if it exists
257
+ if filepath.exists():
258
+ user_files_paths.append(filepath)
259
+ else:
260
+ not_found_files.append(filepath)
257
261
 
258
262
  if not_found_files:
259
263
  logger.warning(
@@ -46,6 +46,7 @@ class UploadCollector(object):
46
46
  comment_regex = re.compile(r"^\s*\/\/.*$")
47
47
  bracket_regex = re.compile(r"^\s*[\{\}]\s*(\/\/.*)?$")
48
48
  list_regex = re.compile(r"^\s*[\]\[]\s*(\/\/.*)?$")
49
+ parenthesis_regex = re.compile(r"^\s*[\(\)]\s*(\/\/.*)?$")
49
50
  go_function_regex = re.compile(r"^\s*func\s*[\{]\s*(\/\/.*)?$")
50
51
  php_end_bracket_regex = re.compile(r"^\s*\);\s*(\/\/.*)?$")
51
52
 
@@ -54,7 +55,7 @@ class UploadCollector(object):
54
55
  lcov_excel_regex = re.compile(r"\/\/ LCOV_EXCL")
55
56
 
56
57
  kt_patterns_to_apply = fix_patterns_to_apply(
57
- [bracket_regex], [comment_block_regex], True
58
+ [bracket_regex, parenthesis_regex], [comment_block_regex], True
58
59
  )
59
60
  go_patterns_to_apply = fix_patterns_to_apply(
60
61
  [empty_line_regex, comment_regex, bracket_regex, go_function_regex],
@@ -71,7 +72,6 @@ class UploadCollector(object):
71
72
  [],
72
73
  False,
73
74
  )
74
-
75
75
  cpp_swift_vala_patterns_to_apply = fix_patterns_to_apply(
76
76
  [empty_line_regex, bracket_regex],
77
77
  [lcov_excel_regex],
@@ -139,6 +139,8 @@ class UploadCollector(object):
139
139
  reason=err.reason,
140
140
  ),
141
141
  )
142
+ except IsADirectoryError as err:
143
+ logger.info(f"Skipping {filename}, found a directory not a file")
142
144
 
143
145
  return UploadCollectionResultFileFixer(
144
146
  path, fixed_lines_without_reason, fixed_lines_with_reason, eof
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codecov-cli
3
- Version: 0.5.2
3
+ Version: 0.6.0
4
4
  Summary: Codecov Command Line Interface
5
5
  Author: Codecov
6
6
  Author-email: support@codecov.io
@@ -19,6 +19,7 @@ codecov_cli/commands/create_report_result.py
19
19
  codecov_cli/commands/empty_upload.py
20
20
  codecov_cli/commands/get_report_results.py
21
21
  codecov_cli/commands/labelanalysis.py
22
+ codecov_cli/commands/process_test_results.py
22
23
  codecov_cli/commands/report.py
23
24
  codecov_cli/commands/send_notifications.py
24
25
  codecov_cli/commands/staticanalysis.py
@@ -4,3 +4,5 @@ ijson==3.*
4
4
  pyyaml==6.*
5
5
  responses==0.21.*
6
6
  tree-sitter==0.20.*
7
+ test-results-parser==0.1.*
8
+ regex
@@ -10,7 +10,7 @@ with open(path.join(here, "README.md"), encoding="utf-8") as f:
10
10
 
11
11
  setup(
12
12
  name="codecov-cli",
13
- version="0.5.2",
13
+ version="0.6.0",
14
14
  packages=find_packages(exclude=["contrib", "docs", "tests*"]),
15
15
  description="Codecov Command Line Interface",
16
16
  long_description=long_description,
@@ -24,6 +24,8 @@ setup(
24
24
  "pyyaml==6.*",
25
25
  "responses==0.21.*",
26
26
  "tree-sitter==0.20.*",
27
+ "test-results-parser==0.1.*",
28
+ "regex",
27
29
  ],
28
30
  entry_points={
29
31
  "console_scripts": [
File without changes
File without changes
File without changes
File without changes