@@ -128,7 +128,7 @@ def pretty_print_dataclass(self) -> str:
128128 def _resolve_gh_username (self , username : str , teamname : str ) -> NamedUser | None :
129129 """Turn a username into a proper GitHub user object."""
130130 try :
131- gh_user : NamedUser = self .gh .get_user (username ) # type: ignore[assignment] # ty:ignore[invalid-assignment]
131+ gh_user : NamedUser = self .gh .get_user (username )
132132 except UnknownObjectException :
133133 logging .exception (
134134 "The user '%s' configured as member of team '%s' does not "
@@ -304,7 +304,7 @@ def ensure_team_hierarchy(self) -> None:
304304
305305 # First, check whether all configured parent teams exist or will be created
306306 for team , attributes in self .configured_teams .items ():
307- if parent := attributes .get ("parent" ): # type: ignore[union-attr] # ty:ignore[unresolved-attribute]
307+ if parent := attributes .get ("parent" ): # ty:ignore[unresolved-attribute]
308308 if parent not in self .configured_teams :
309309 if parent not in self .current_teams_str :
310310 logging .critical (
@@ -338,7 +338,7 @@ def ensure_team_hierarchy(self) -> None:
338338 if team in ordered_teams :
339339 continue
340340 # Team has parent, but parent not ordered yet
341- if (parent := attributes .get ("parent" )) and parent not in ordered_teams : # type: ignore[union-attr] # ty:ignore[unresolved-attribute]
341+ if (parent := attributes .get ("parent" )) and parent not in ordered_teams : # ty:ignore[unresolved-attribute]
342342 continue
343343 # Team has no parent, or parent already ordered
344344 ordered_teams [team ] = attributes
@@ -350,7 +350,7 @@ def create_missing_teams(self, dry: bool = False) -> None:
350350 for team , attributes in self .configured_teams .items ():
351351 if team not in self .current_teams_str :
352352 # If a parent team is configured, try to get its ID
353- if parent := attributes .get ("parent" ): # type: ignore[union-attr] # ty:ignore[unresolved-attribute]
353+ if parent := attributes .get ("parent" ): # ty:ignore[unresolved-attribute]
354354 try :
355355 parent_id = self .org .get_team_by_slug (sluggify_teamname (parent )).id
356356 except UnknownObjectException :
@@ -436,21 +436,21 @@ def sync_current_teams_settings(self, dry: bool = False) -> None:
436436 # Use dictionary comprehensions to build the dictionaries with the
437437 # relevant team settings for comparison
438438 configured_team_configs = {
439- key : self .configured_teams [team .name ].get (key ) # type: ignore[union-attr] # ty:ignore[unresolved-attribute]
439+ key : self .configured_teams [team .name ].get (key ) # ty:ignore[unresolved-attribute]
440440 for key in self .TEAM_CONFIG_FIELDS
441441 # Only add keys that are actually in the configuration. Deals
442442 # with settings that should be changed, as they are neither
443443 # defined in the default or team config, and marked as
444444 # <keep-current>
445- if key in self .configured_teams [team .name ] # type: ignore[operator] # ty:ignore[unsupported-operator]
445+ if key in self .configured_teams [team .name ] # ty:ignore[unsupported-operator]
446446 }
447447 current_team_configs = {
448448 key : getattr (team , key )
449449 for key in self .TEAM_CONFIG_FIELDS
450450 # Only compare current team settings with keys that are defined
451451 # as the configured team settings. Taking out settings that
452452 # shall not be changed
453- if key in self .configured_teams [team .name ] # type: ignore[operator] # ty:ignore[unsupported-operator]
453+ if key in self .configured_teams [team .name ] # ty:ignore[unsupported-operator]
454454 }
455455
456456 # Resolve parent team id from parent Team object or team string, and sort
@@ -480,7 +480,7 @@ def sync_current_teams_settings(self, dry: bool = False) -> None:
480480 # Execute team setting changes
481481 if not dry :
482482 try :
483- team .edit (name = team .name , ** configured_team_configs ) # type: ignore[arg-type] # ty:ignore[invalid-argument-type]
483+ team .edit (name = team .name , ** configured_team_configs ) # ty:ignore[invalid-argument-type]
484484 except GithubException as exc :
485485 logging .critical (
486486 "Team '%s' settings could not be edited. Error: \n %s" ,
@@ -819,7 +819,7 @@ def _document_unconfigured_team_repo_permissions(
819819 """Create a record of all members of a team and their permissions on a
820820 repo due to being member of an unconfigured team.
821821 """
822- users_of_unconfigured_team : dict [NamedUser , str ] = self .current_teams [team ].get ("members" ) # type: ignore[assignment] # ty:ignore[invalid-assignment]
822+ users_of_unconfigured_team : dict [NamedUser , str ] = self .current_teams [team ].get ("members" ) # ty:ignore[invalid-assignment]
823823 # Initiate this repo in the dict as dict if not present
824824 if repo_name not in self .unconfigured_team_repo_permissions :
825825 self .unconfigured_team_repo_permissions [repo_name ] = {}
@@ -893,7 +893,7 @@ def sync_repo_permissions(self, dry: bool = False, ignore_archived: bool = False
893893 if self .configured_teams [team .name ] is None :
894894 remove = True
895895 # Handle: Team is configured, contains config
896- elif repos := self .configured_teams [team .name ].get ("repos" , []): # type: ignore[union-attr] # ty:ignore[unresolved-attribute]
896+ elif repos := self .configured_teams [team .name ].get ("repos" , []): # ty:ignore[unresolved-attribute]
897897 # If this repo has not been found in the configured repos
898898 # for the team, remove all permissions
899899 if repo .name not in repos :
0 commit comments