@@ -20,7 +20,7 @@ class TextObject(JsonObject):
2020 attributes = {"text" , "type" , "emoji" }
2121 logger = logging .getLogger (__name__ )
2222
23- def _subtype_warning (self ): # skipcq: PYL-R0201
23+ def _subtype_warning (self ):
2424 warnings .warn (
2525 "subtype is deprecated since slackclient 2.6.0, use type instead" ,
2626 DeprecationWarning ,
@@ -36,17 +36,17 @@ def parse(
3636 text : Union [str , Dict [str , Any ], "TextObject" ],
3737 default_type : str = "mrkdwn" ,
3838 ) -> Optional ["TextObject" ]:
39- if not text : # skipcq: PYL-R1705
39+ if not text :
4040 return None
4141 elif isinstance (text , str ):
42- if default_type == PlainTextObject .type : # skipcq: PYL-R1705
42+ if default_type == PlainTextObject .type :
4343 return PlainTextObject .from_str (text )
4444 else :
4545 return MarkdownTextObject .from_str (text )
4646 elif isinstance (text , dict ):
4747 d = copy .copy (text )
4848 t = d .pop ("type" )
49- if t == PlainTextObject .type : # skipcq: PYL-R1705
49+ if t == PlainTextObject .type :
5050 return PlainTextObject (** d )
5151 else :
5252 return MarkdownTextObject (** d )
@@ -59,7 +59,7 @@ def parse(
5959 def __init__ (
6060 self ,
6161 text : str ,
62- type : Optional [str ] = None , # skipcq: PYL-W0622
62+ type : Optional [str ] = None ,
6363 subtype : Optional [str ] = None ,
6464 emoji : Optional [bool ] = None ,
6565 ** kwargs ,
@@ -273,14 +273,14 @@ def parse_all(cls, options: Optional[Sequence[Union[Dict[str, Any], "Option"]]])
273273 cls .logger .warning (f"Unknown option object detected and skipped ({ o } )" )
274274 return option_objects
275275
276- def to_dict (self , option_type : str = "block" ) -> Dict [str , Any ]: # skipcq: PYL-W0221
276+ def to_dict (self , option_type : str = "block" ) -> Dict [str , Any ]:
277277 """
278278 Different parent classes must call this with a valid value from OptionTypes -
279279 either "dialog", "action", or "block", so that JSON is returned in the
280280 correct shape.
281281 """
282282 self .validate_json ()
283- if option_type == "dialog" : # skipcq: PYL-R1705
283+ if option_type == "dialog" :
284284 return {"label" : self .label , "value" : self .value }
285285 elif option_type == "action" or option_type == "attachment" :
286286 # "action" can be confusing but it means a legacy message action in attachments
@@ -343,7 +343,7 @@ def __init__(
343343 options: A list of no more than 100 Option objects.
344344 """ # noqa prevent flake8 blowing up on the long URL
345345 # default_type=PlainTextObject.type is for backward-compatibility
346- self ._label : Optional [TextObject ] = TextObject .parse (label , default_type = PlainTextObject .type ) # type: ignore[arg-type]
346+ self ._label : Optional [TextObject ] = TextObject .parse (label , default_type = PlainTextObject .type ) # type: ignore[arg-type] # noqa: E501
347347 self .label : Optional [str ] = self ._label .text if self ._label else None
348348 self .options = Option .parse_all (options ) # compatible with version 2.5
349349 show_unknown_key_warning (self , others )
@@ -373,10 +373,10 @@ def parse_all(
373373 cls .logger .warning (f"Unknown option group object detected and skipped ({ o } )" )
374374 return option_group_objects
375375
376- def to_dict (self , option_type : str = "block" ) -> Dict [str , Any ]: # skipcq: PYL-W0221
376+ def to_dict (self , option_type : str = "block" ) -> Dict [str , Any ]:
377377 self .validate_json ()
378378 dict_options = [o .to_dict (option_type ) for o in self .options ] # type: ignore[union-attr]
379- if option_type == "dialog" : # skipcq: PYL-R1705
379+ if option_type == "dialog" :
380380 return {
381381 "label" : self .label ,
382382 "options" : dict_options ,
@@ -405,7 +405,7 @@ class ConfirmObject(JsonObject):
405405 @classmethod
406406 def parse (cls , confirm : Union ["ConfirmObject" , Dict [str , Any ]]):
407407 if confirm :
408- if isinstance (confirm , ConfirmObject ): # skipcq: PYL-R1705
408+ if isinstance (confirm , ConfirmObject ):
409409 return confirm
410410 elif isinstance (confirm , dict ):
411411 return ConfirmObject (** confirm )
@@ -462,8 +462,8 @@ def deny_length(self) -> bool:
462462 def _validate_confirm_style (self ) -> bool :
463463 return self ._style is None or self ._style in ["primary" , "danger" ]
464464
465- def to_dict (self , option_type : str = "block" ) -> Dict [str , Any ]: # skipcq: PYL-W0221
466- if option_type == "action" : # skipcq: PYL-R1705
465+ def to_dict (self , option_type : str = "block" ) -> Dict [str , Any ]:
466+ if option_type == "action" :
467467 # deliberately skipping JSON validators here - can't find documentation
468468 # on actual limits here
469469 json : Dict [str , Union [str , dict ]] = {
@@ -498,7 +498,7 @@ class DispatchActionConfig(JsonObject):
498498 @classmethod
499499 def parse (cls , config : Union ["DispatchActionConfig" , Dict [str , Any ]]):
500500 if config :
501- if isinstance (config , DispatchActionConfig ): # skipcq: PYL-R1705
501+ if isinstance (config , DispatchActionConfig ):
502502 return config
503503 elif isinstance (config , dict ):
504504 return DispatchActionConfig (** config )
@@ -518,7 +518,7 @@ def __init__(
518518 """
519519 self ._trigger_actions_on = trigger_actions_on or []
520520
521- def to_dict (self ) -> Dict [str , Any ]: # skipcq: PYL-W0221
521+ def to_dict (self ) -> Dict [str , Any ]:
522522 self .validate_json ()
523523 json = {}
524524 if self ._trigger_actions_on :
@@ -533,7 +533,7 @@ def __init__(self, *, url: str, customizable_input_parameters: Optional[List[Dic
533533 self ._url = url
534534 self ._customizable_input_parameters = customizable_input_parameters
535535
536- def to_dict (self ) -> Dict [str , Any ]: # skipcq: PYL-W0221
536+ def to_dict (self ) -> Dict [str , Any ]:
537537 self .validate_json ()
538538 json = {"url" : self ._url }
539539 if self ._customizable_input_parameters is not None :
@@ -551,7 +551,7 @@ def __init__(
551551 ):
552552 self ._trigger = trigger
553553
554- def to_dict (self ) -> Dict [str , Any ]: # skipcq: PYL-W0221
554+ def to_dict (self ) -> Dict [str , Any ]:
555555 self .validate_json ()
556556 json = {}
557557 if isinstance (self ._trigger , WorkflowTrigger ):
@@ -580,7 +580,7 @@ def __init__(
580580 self ._id = id
581581 self ._url = url
582582
583- def to_dict (self ) -> Dict [str , Any ]: # skipcq: PYL-W0221
583+ def to_dict (self ) -> Dict [str , Any ]:
584584 self .validate_json ()
585585 json = {}
586586 if self ._id is not None :
0 commit comments