Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
change name of extension not present constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
lbarraga committed May 23, 2024
1 parent 43d8e72 commit 63b2629
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@

class ExtensionNotPresentConstraint(BaseModel):
type: ConstraintType = ConstraintType.EXTENSION_NOT_PRESENT
extension: str
not_present_extension: str

def validate_constraint(self, path: Path) -> ExtensionNotPresentConstraintResult:
directory = os.listdir(path)

files_with_extension = [file for file in directory if file.endswith(self.extension)]
files_with_extension = [file for file in directory if file.endswith(self.not_present_extension)]

if files_with_extension:
return ExtensionNotPresentConstraintResult(
extension=self.extension,
extension=self.not_present_extension,
is_ok=False,
files_with_extension=files_with_extension,
)

return ExtensionNotPresentConstraintResult(
extension=self.extension,
extension=self.not_present_extension,
is_ok=True,
files_with_extension=files_with_extension,
)

0 comments on commit 63b2629

Please sign in to comment.