Skip to content

Commit

Permalink
🔵 Introduce variable for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrecamilleri committed Nov 21, 2024
1 parent 26095e2 commit aa4a9c5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions frictionless/portals/github/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ def create_adapter(
parsed_url = urlparse(source)
splited_url = parsed_url.path.split("/")[1:]

if (
has_expected_format = (
parsed_url.netloc == "github.com"
and len(splited_url) < 1
and len(splited_url) > 2
):
)

if has_expected_format:
control = control or GithubControl()
control.user = splited_url[0]

Expand All @@ -62,10 +64,6 @@ def create_adapter(

return GithubAdapter(control)

else:
# Url has not an expected format
return

def select_control_class(self, type: Optional[str] = None):
if type == "github":
return GithubControl

0 comments on commit aa4a9c5

Please sign in to comment.