Skip to content

Commit

Permalink
fix: add ruff suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
randomicecube committed Oct 29, 2024
1 parent 8c99ffc commit c9797a1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions tool/extract_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def extract_deps_from_pnpm_lockfile(pnpm_lockfile_yaml):
# pkg_name_with_resolution = set()
deps_list_data = {}

package_keys = sorted(list(yaml_data.get("packages", {}).keys()))
patches = sorted(list(yaml_data.get("patchedDependencies", {}).keys()))
package_keys = sorted(yaml_data.get("packages", {}).keys())
patches = sorted(yaml_data.get("patchedDependencies", {}).keys())

deps_list_data = {
"resolutions": package_keys,
Expand Down Expand Up @@ -90,7 +90,7 @@ def extract_deps_from_npm(npm_lock_file):
pkg_name_with_resolution.add(f"{package_name}@{package_info['version']}")

deps_list_data = {
"resolutions": sorted(list(pkg_name_with_resolution)),
"resolutions": sorted(pkg_name_with_resolution),
"patches": patches,
}

Expand Down
1 change: 0 additions & 1 deletion tool/get_pr_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def get_pr_info(data):
for author in authors:
commit_sha = author.get("sha")
commit_node_id = author.get("node_id")
commit_url = author.get("commit_url")

c.execute(
"SELECT pr_data FROM pr_info_sample WHERE commit_node_id=?",
Expand Down
2 changes: 1 addition & 1 deletion tool/get_pr_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_first_pr_info(search_string):
}
}
}
"""

Expand Down
1 change: 0 additions & 1 deletion tool/github_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def get_github_repo_url(folder, dep_list, pm):
pbar.update(1)

# Write collected data to files
unique_repos_output = sorted(set(repos_output))
outputs = {
# "github_repo_all.txt": repos_output,
# "github_repo_unique.txt": unique_repos_output,
Expand Down
3 changes: 1 addition & 2 deletions tool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ def get_args():
parser.add_argument(
"-pm",
"--package-manager",
choices=["yarn-berry", "yarn-classic", "pnpm", "maven"],
required=True,
help="The package manager used in the project.",
choices=["yarn-classic", "yarn-berry", "pnpm", "npm"],
choices=["yarn-classic", "yarn-berry", "pnpm", "npm", "maven"],
)
parser.add_argument(
"--pnpm-scope",
Expand Down
6 changes: 3 additions & 3 deletions tool/report_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def create_dataframe(record):


def filter_df(df):
df_author_first = df[(df["author_first"] == True)]
df_review_first = df[df["prr_first"] == True]
df_both_first = df[(df["author_first"] == True) & (df["prr_first"] == True)]
df_author_first = df[(df["author_first"])]
df_review_first = df[df["prr_first"]]
df_both_first = df[(df["author_first"]) & (df["prr_first"])]

return df_author_first, df_review_first, df_both_first

Expand Down

0 comments on commit c9797a1

Please sign in to comment.