1212import httpx
1313
1414from ._settings import settings
15- from .constants import KNOWN_GH_USERS , KNOWN_INVALID_GH_USERS
15+ from .constants import KNOWN_GITHUB_USERS , KNOWN_INVALID_GITHUB_USERS
1616from .field_warning import issue_warning
1717from .type_guards import is_mapping , is_sequence , is_tuple
1818from .validation_context import get_validation_context
@@ -57,18 +57,20 @@ def validate_unique_entries(seq: Sequence[Hashable]):
5757 return seq
5858
5959
60- def validate_gh_user (username : str , hotfix_known_errorenous_names : bool = True ) -> str :
60+ def validate_github_user (
61+ username : str , hotfix_known_errorenous_names : bool = True
62+ ) -> str :
6163 if hotfix_known_errorenous_names :
6264 if username == "Constantin Pape" :
6365 return "constantinpape"
6466
6567 if (
66- username .lower () in KNOWN_GH_USERS
68+ username .lower () in KNOWN_GITHUB_USERS
6769 or not get_validation_context ().perform_io_checks
6870 ):
6971 return username
7072
71- if username .lower () in KNOWN_INVALID_GH_USERS :
73+ if username .lower () in KNOWN_INVALID_GITHUB_USERS :
7274 raise ValueError (f"Known invalid GitHub user '{ username } '" )
7375
7476 try :
@@ -89,9 +91,9 @@ def validate_gh_user(username: str, hotfix_known_errorenous_names: bool = True)
8991 value = username ,
9092 )
9193 elif r .status_code != 200 :
92- KNOWN_INVALID_GH_USERS .add (username .lower ())
94+ KNOWN_INVALID_GITHUB_USERS .add (username .lower ())
9395 raise ValueError (f"Could not find GitHub user '{ username } '" )
9496
95- KNOWN_GH_USERS .add (username .lower ())
97+ KNOWN_GITHUB_USERS .add (username .lower ())
9698
9799 return username
0 commit comments