@@ -302,33 +302,38 @@ def __call__(self) -> None:
302302 "[NO_COMMITS_TO_BUMP]\n The commits found are not eligible to be bumped"
303303 )
304304
305- files : list [str ] = []
305+ updated_files : list [str ] = []
306306 dry_run = self .arguments ["dry_run" ]
307307 if self .changelog_flag :
308- args = {
308+ changelog_args = {
309309 "unreleased_version" : new_tag_version ,
310310 "template" : self .template ,
311311 "extras" : self .extras ,
312312 "incremental" : True ,
313313 "dry_run" : dry_run ,
314314 }
315315 if self .changelog_to_stdout :
316- changelog_cmd = Changelog (self .config , {** args , "dry_run" : True }) # type: ignore[typeddict-item]
316+ changelog_cmd = Changelog (
317+ self .config ,
318+ {** changelog_args , "dry_run" : True }, # type: ignore[typeddict-item]
319+ )
317320 try :
318321 changelog_cmd ()
319322 except DryRunExit :
320323 pass
321324
322- args ["file_name" ] = self .file_name
323- changelog_cmd = Changelog (self .config , args ) # type: ignore[arg-type]
325+ changelog_cmd = Changelog (
326+ self .config ,
327+ {** changelog_args , "file_name" : self .file_name }, # type: ignore[typeddict-item]
328+ )
324329 changelog_cmd ()
325- files .append (changelog_cmd .file_name )
330+ updated_files .append (changelog_cmd .file_name )
326331
327332 # Do not perform operations over files or git.
328333 if dry_run :
329334 raise DryRunExit ()
330335
331- files .extend (
336+ updated_files .extend (
332337 bump .update_version_in_files (
333338 str (current_version ),
334339 str (new_version ),
@@ -360,13 +365,13 @@ def __call__(self) -> None:
360365 raise ExpectedExit ()
361366
362367 # FIXME: check if any changes have been staged
363- git .add (* files )
368+ git .add (* updated_files )
364369 c = git .commit (message , args = self ._get_commit_args ())
365370 if self .retry and c .return_code != 0 and self .changelog_flag :
366371 # Maybe pre-commit reformatted some files? Retry once
367372 logger .debug ("1st git.commit error: %s" , c .err )
368373 logger .info ("1st commit attempt failed; retrying once" )
369- git .add (* files )
374+ git .add (* updated_files )
370375 c = git .commit (message , args = self ._get_commit_args ())
371376 if c .return_code != 0 :
372377 err = c .err .strip () or c .out
0 commit comments