@@ -39,7 +39,8 @@ def task_params(argspec):
3939 if argspec .annotations .get (arg ) is None : # is param
4040 _ps .append (task_param (
4141 arg ,
42- None if i < first_default else argspec .defaults [i - first_default ]))
42+ None if i < first_default else argspec .defaults [
43+ i - first_default ]))
4344 return _ps
4445
4546
@@ -107,7 +108,7 @@ def task_run(func, args):
107108 "outputs" : {
108109 "resources" : _or ,
109110 }})
110- global SERVICE_ACCOUNT_NAME
111+ global SERVICE_ACCOUNT_NAME # pylint: disable=global-statement
111112 if SERVICE_ACCOUNT_NAME is not None :
112113 _r ["spec" ]["serviceAccountName" ] = SERVICE_ACCOUNT_NAME
113114 return _r
@@ -161,23 +162,24 @@ def task_run_resource(param, arg):
161162 }}
162163
163164
164- class FakeGitResource :
165+ class FakeGitResource : # pylint: disable=too-few-public-methods
165166 '''Used in dry-run a Task function, which might call res_param.revision'''
166167
167168 def __init__ (self , io , arg ):
168169 self .url = f"$({ io } s.resources.{ k8s .safe_name (arg )} .url)"
169170 self .revision = f"$({ io } s.resources.{ k8s .safe_name (arg )} .revision)"
170171
171172
172- class FakeImageResource :
173+ class FakeImageResource : # pylint: disable=too-few-public-methods
173174 '''Used in dry-run a Task function, which might call res_param.url'''
174175
175176 def __init__ (self , io , arg ):
176177 self .url = f"$({ io } s.resources.{ k8s .safe_name (arg )} .url)"
177178
178179
179180def _fake_resource (_io , _typ , arg ):
180- return FakeGitResource (_io , arg ) if _typ == "git" else FakeImageResource (_io , arg )
181+ return FakeGitResource (_io , arg ) \
182+ if _typ == "git" else FakeImageResource (_io , arg )
181183
182184
183185STEPS = [] # For holding steps of a Task.
@@ -194,7 +196,7 @@ def task_steps(func):
194196 else :
195197 fake_args .append (f"$(inputs.params.{ k8s .safe_name (arg )} )" )
196198
197- global STEPS
199+ global STEPS # pylint: disable=global-statement
198200 STEPS = []
199201 func (* fake_args )
200202 return STEPS
@@ -210,12 +212,14 @@ def add_step(name, image, cmd, args, env):
210212 }
211213 if env is not None :
212214 _s ["env" ] = step_env (env )
213- global STEPS
215+ global STEPS # pylint: disable=global-statement
214216 STEPS .append (_s )
215217
216218
217219def step_env (env ):
218- '''For the convenience of Fluid users, env is a dict; Tekton requires a list'''
220+ '''For the convenience of Fluid users, env is a dict;
221+ Tekton requires a list
222+ '''
219223 return [{"name" : k , "value" : v } for i , (k , v ) in enumerate (env .items ())]
220224
221225
@@ -229,7 +233,8 @@ def _resource(name, typ, params):
229233 },
230234 "spec" : {
231235 "type" : typ ,
232- "params" : [{"name" : k , "value" : v } for i , (k , v ) in enumerate (params .items ())]}}
236+ "params" : [{"name" : k , "value" : v } for i , (k , v ) in enumerate (
237+ params .items ())]}}
233238
234239
235240def git_resource (name , url , revision ):
0 commit comments