Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[code smell] Refactor check_url.py #373

Open
bkreider opened this issue Jan 9, 2025 · 0 comments
Open

[code smell] Refactor check_url.py #373

bkreider opened this issue Jan 9, 2025 · 0 comments

Comments

@bkreider
Copy link
Contributor

bkreider commented Jan 9, 2025

See discussion here: https://github.com/anaconda/anaconda-linter/pull/369/files#diff-33b60c1e875849a20005276fa884473abaace7572cbca8faa64376e2493f9f24

Refactor for short-circuit evaluation.

        def _verify_url(url: str) -> None:
            if url:
                response_data = utils.check_url(url)
                if response_data["code"] < 0 or response_data["code"] >= 400:
                    if "domain_redirect" not in response_data:
                        self.message(url, response_data["message"], section=section)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant