File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 22 - repo : https://github.com/pre-commit/pre-commit-hooks
33 rev : v6.0.0
44 hooks :
5- - id : check-yaml
65 - id : check-json
76 - id : check-xml
7+ - id : check-yaml
8+ args : [--unsafe] # allow !!python/name:... tags in mkdocs.yml
89 - id : end-of-file-fixer
910 - id : trailing-whitespace
1011 - repo : https://github.com/astral-sh/ruff-pre-commit
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ select = [
150150]
151151extend-ignore = [" PIE790" ]
152152mccabe.max-complexity = 13
153- per-file-ignores."scheduler/models/args.py" = [" DJ012" , " INT001 " ]
153+ per-file-ignores."scheduler/models/args.py" = [" DJ012" ]
154154per-file-ignores."scheduler/models/ephemeral_models.py" = [" DJ008" ]
155155per-file-ignores."scheduler/models/task.py" = [" DJ001" , " DJ012" ]
156156
Original file line number Diff line number Diff line change @@ -39,13 +39,8 @@ class ArgType(models.TextChoices):
3939
4040 def clean (self ) -> None :
4141 if self .arg_type not in ARG_TYPE_TYPES_DICT :
42- raise ValidationError (
43- {
44- "arg_type" : ValidationError (
45- _ (f"Could not parse { self .arg_type } , options are: { ARG_TYPE_TYPES_DICT .keys ()} " ), code = "invalid"
46- )
47- }
48- )
42+ msg = _ ("Could not parse %s, options are: %s" ) % (self .arg_type , ARG_TYPE_TYPES_DICT .keys ())
43+ raise ValidationError ({"arg_type" : ValidationError (msg , code = "invalid" )})
4944 try :
5045 if self .arg_type == "callable" :
5146 utils .callable_func (self .val )
@@ -57,9 +52,8 @@ def clean(self) -> None:
5752 elif self .arg_type == "int" :
5853 int (self .val )
5954 except Exception :
60- raise ValidationError (
61- {"arg_type" : ValidationError (_ (f"Could not parse { self .val } as { self .arg_type } " ), code = "invalid" )}
62- )
55+ msg = _ ("Could not parse %s as %s" ) % (self .val , self .arg_type )
56+ raise ValidationError ({"arg_type" : ValidationError (msg , code = "invalid" )})
6357
6458 def save (self , ** kwargs : Any ) -> None :
6559 super (BaseTaskArg , self ).save (** kwargs )
You can’t perform that action at this time.
0 commit comments