File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515PRIMER_DIRECTORY_PATH = Path ("tests" ) / ".pylint_primer_tests"
1616
1717
18+ class DirtyPrimerDirectoryException (Exception ):
19+ """We can't pull if there's local changes."""
20+
21+ def __init__ (self , path : Path | str ):
22+ super ().__init__ (
23+ rf"""
24+
25+ /!\ Can't pull /!\
26+
27+ In order for the prepare command to be able to pull please cleanup your local repo:
28+ cd { path }
29+ git diff
30+ """
31+ )
32+
33+
1834class PackageToLint :
1935 """Represents data about a package to be tested during primer tests."""
2036
@@ -120,6 +136,8 @@ def _pull_repository(self) -> str:
120136 )
121137 try :
122138 repo = Repo (self .clone_directory )
139+ if repo .is_dirty ():
140+ raise DirtyPrimerDirectoryException (self .clone_directory )
123141 origin = repo .remotes .origin
124142 origin .pull ()
125143 except GitCommandError as e :
You can’t perform that action at this time.
0 commit comments