Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pipe/pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def filter_paths(path):
stderr=subprocess.PIPE, universal_newlines=True)
self.standards_failure = False if phpcs.returncode == 0 else True

phpcs_output = phpcs.stdout
phpcs_output = phpcs.stdout.strip()

if phpcs_output:
with open("test-results/phpcs.xml", 'a') as output_file:
Expand Down Expand Up @@ -173,13 +173,17 @@ def read_failures_from_file(file):
# Covert paths to relative equivalent
workspace_path = "/opt/atlassian/pipelines/agent/build/"
path = suite.name.replace(workspace_path, '')

# Extract line number from name if present
# Example: /some/path/to/file (10:11)
line_match = re.search(r"\((\d*):.*\)", case.name)
line = line_match.group(1) if line_match else "1"

results.append({
"path": path,
"title": case.name,
"summary": result.message,
# Extract line number from name
# Example: /some/path/to/file (10:11)
"line": re.search("\((\d*):.*\)", case.name).group(1)
"line": line
})

return results
Expand Down