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

CI pr-format: Pipfile内にパッケージがあるかを大文字・小文字区別せず判定する #3562

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/pr_format/pr_format/fix_pipfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ def get_pipfile_packages(pipfile: Pipfile) -> set[str] | NoReturn:
if not is_pipfile_packages(pipfile_value):
raise TypeError("Failed to cast to PipfilePackages: " + str(pipfile_value))

pipfile_packages |= set(pipfile_value.keys())
for package_name in pipfile_value.keys():
pipfile_packages.add(package_name.lower())

return pipfile_packages

Expand All @@ -175,9 +176,8 @@ def exist_package_in_pipfile(packages: list[str], pipfile_packages: set[str]) ->
:return: 与えられたパッケージ群のいずれかがPipfile内に存在するか
"""
for package_name in packages:
for pn in [package_name, package_name.lower()]:
if pn in pipfile_packages:
return True
if package_name.lower() in pipfile_packages:
return True

return False

Expand Down
Loading