15
15
class ReleaseHelperGroup (click .Group ):
16
16
"""Click group tailored to jupyter-releaser"""
17
17
18
- _needs_checkout_dir : t .Dict [str , bool ] = {} # noqa
18
+ _needs_checkout_dir : t .Dict [str , bool ] = {} # noqa: RUF012
19
19
20
- def invoke (self , ctx ): # noqa
20
+ def invoke (self , ctx ):
21
21
"""Handle jupyter-releaser config while invoking a command"""
22
22
# Get the command name and make sure it is valid
23
23
cmd_name = ctx .protected_args [0 ]
@@ -96,12 +96,11 @@ def invoke(self, ctx): # noqa
96
96
ctx .args .append (arg )
97
97
ctx .args .append (val )
98
98
continue
99
- else :
100
- val = ctx .args [ctx .args .index (arg ) + 1 ]
101
- if "token" in name .lower ():
102
- val = "***"
103
- util .log (f"Using cli arg for { name } : '{ val } '" )
104
- continue
99
+ val = ctx .args [ctx .args .index (arg ) + 1 ]
100
+ if "token" in name .lower ():
101
+ val = "***"
102
+ util .log (f"Using cli arg for { name } : '{ val } '" )
103
+ continue
105
104
106
105
util .log (f"Using default value for { name } : '{ param .default } '" )
107
106
@@ -141,16 +140,15 @@ def invoke(self, ctx): # noqa
141
140
142
141
os .chdir (orig_dir )
143
142
144
- def list_commands (self , ctx ):
143
+ def list_commands (self , ctx ): # noqa: ARG002
145
144
"""List commands in insertion order"""
146
145
return self .commands .keys ()
147
146
148
147
149
148
@click .group (cls = ReleaseHelperGroup )
150
149
@click .option ("--force" , default = False , help = "Force a command to run even when skipped by config" )
151
- def main (force ):
150
+ def main (force ): # noqa: ARG001
152
151
"""Jupyter Releaser scripts"""
153
- pass
154
152
155
153
156
154
# Extracted common options
@@ -357,7 +355,6 @@ def inner(func):
357
355
def list_envvars ():
358
356
"""List the environment variables"""
359
357
# This is implemented in ReleaseHelperGroup.invoke
360
- pass
361
358
362
359
363
360
@main .command ()
@@ -709,7 +706,7 @@ def publish_release(auth, dry_run, release_url, silent):
709
706
"--expected-sha" , help = "The expected sha of the branch HEAD" , envvar = "RH_EXPECTED_SHA"
710
707
)
711
708
@use_checkout_dir ()
712
- def ensure_sha (ref , branch , repo , dry_run , expected_sha ):
709
+ def ensure_sha (ref , branch , repo , dry_run , expected_sha ): # noqa: ARG001
713
710
"""Ensure that a sha has not changed."""
714
711
util .ensure_sha (dry_run , expected_sha , branch )
715
712
@@ -735,7 +732,7 @@ def forwardport_changelog(auth, ref, branch, repo, username, changelog_path, dry
735
732
@add_options (changelog_path_options )
736
733
@add_options (dry_run_options )
737
734
@use_checkout_dir ()
738
- def publish_changelog (auth , ref , branch , repo , changelog_path , dry_run ):
735
+ def publish_changelog (auth , ref , branch , repo , changelog_path , dry_run ): # noqa: ARG001
739
736
"""Remove changelog placeholder entries."""
740
737
lib .publish_changelog (branch , repo , auth , changelog_path , dry_run )
741
738
0 commit comments