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