Skip to content

Commit

Permalink
Support relative paths in the --file option
Browse files Browse the repository at this point in the history
So far, the file option needed a simple but
necessary workaround to support relative file
paths. With this change, simply entering the
filename in the --file option will be sufficient.
  • Loading branch information
Nora Zinaeddin committed Jun 7, 2024
1 parent 5e20cc1 commit e977562
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion analyzer/codechecker_analyzer/cmd/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import os
import shutil
import sys
import glob
from typing import List
from pathlib import Path

from tu_collector import tu_collector

Expand Down Expand Up @@ -891,7 +893,8 @@ def get_affected_file_paths(
"""
file_paths = [] # Use list to keep the order of the file paths.
for file_filter in file_filters:
file_paths.append(file_filter)
file_paths.append(str(Path(file_filter).resolve())
if '*' not in file_filter else file_filter)

if os.path.exists(file_filter) and \
file_filter.endswith(header_file_extensions):
Expand Down

0 comments on commit e977562

Please sign in to comment.