mirror of
https://github.com/karma-riuk/crab.git
synced 2025-07-04 21:28:12 +02:00
covered newly discovered edge case
This commit is contained in:
@ -135,6 +135,9 @@ class BuildHandler(ABC):
|
||||
if not filepath.endswith('.java'):
|
||||
raise NotJavaFileError(f"File '{filepath}' does not end with .java")
|
||||
|
||||
if not os.path.exists(os.path.join(self.path, filepath)):
|
||||
raise FileNotFoundInRepoError(f"File '{filepath}' not found in repo")
|
||||
|
||||
with open(os.path.join(self.path, filepath)) as f:
|
||||
try:
|
||||
parsed_tree = javalang.parse.parse(f.read())
|
||||
@ -360,6 +363,9 @@ class NotJavaFileError(HandlerException):
|
||||
class NoPackageFoundError(HandlerException):
|
||||
reason_for_failure = "Java file did not contain a valid package name"
|
||||
|
||||
class FileNotFoundInRepoError(HandlerException):
|
||||
reason_for_failure = "Commented file not found in repo (likely renamed or deleted)"
|
||||
|
||||
def merge_download_lines(lines: list) -> list:
|
||||
"""
|
||||
Merges lines that are part of the same download block in Maven output.
|
||||
|
Reference in New Issue
Block a user