@@ -177,36 +177,22 @@ def __call__(self) -> None:
177
177
build_metadata = self .arguments ["build_metadata" ]
178
178
get_next = self .arguments ["get_next" ]
179
179
allow_no_commit = self .arguments ["allow_no_commit" ]
180
+ major_version_zero = self .arguments ["major_version_zero" ]
180
181
181
182
if manual_version :
182
- if increment :
183
- raise NotAllowed ("--increment cannot be combined with MANUAL_VERSION" )
184
-
185
- if prerelease :
186
- raise NotAllowed ("--prerelease cannot be combined with MANUAL_VERSION" )
187
-
188
- if devrelease is not None :
189
- raise NotAllowed ("--devrelease cannot be combined with MANUAL_VERSION" )
190
-
191
- if is_local_version :
192
- raise NotAllowed (
193
- "--local-version cannot be combined with MANUAL_VERSION"
194
- )
195
-
196
- if build_metadata :
197
- raise NotAllowed (
198
- "--build-metadata cannot be combined with MANUAL_VERSION"
199
- )
200
-
201
- if self .bump_settings ["major_version_zero" ]:
202
- raise NotAllowed (
203
- "--major-version-zero cannot be combined with MANUAL_VERSION"
204
- )
205
-
206
- if get_next :
207
- raise NotAllowed ("--get-next cannot be combined with MANUAL_VERSION" )
183
+ for val , option in (
184
+ (increment , "--increment" ),
185
+ (prerelease , "--prerelease" ),
186
+ (devrelease is not None , "--devrelease" ),
187
+ (is_local_version , "--local-version" ),
188
+ (build_metadata , "--build-metadata" ),
189
+ (major_version_zero , "--major-version-zero" ),
190
+ (get_next , "--get-next" ),
191
+ ):
192
+ if val :
193
+ raise NotAllowed (f"{ option } cannot be combined with MANUAL_VERSION" )
208
194
209
- if self . bump_settings [ " major_version_zero" ] and current_version .release [0 ]:
195
+ if major_version_zero and current_version .release [0 ]:
210
196
raise NotAllowed (
211
197
f"--major-version-zero is meaningless for current version { current_version } "
212
198
)
0 commit comments