mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:42:10 +00:00

* Add script for ecosystem wide checks of all rules and fixes This adds my personal script for checking an entire checkout of ~2.1k packages for panics, autofix errors and similar problems. It's not really meant to be used by anybody else but i thought it's better if it lives in the repo than if it doesn't. For reference, this is the current output of failing autofixes: https://gist.github.com/konstin/c3fada0135af6cacec74f166adf87a00. Trimmed down to the useful information: https://gist.github.com/konstin/c864f4c300c7903a24fdda49635c5da9 * Keep github template intact * Remove the need for ripgrep * sort output
26 lines
1.3 KiB
Bash
Executable file
26 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
# This is @konstin's setup for checking an entire checkout of ~2.1k packages for
|
|
# panics, autofix errors and similar problems.
|
|
#
|
|
# We put this in a docker container because processing random scraped code from GitHub is
|
|
# [kinda dangerous](https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html)
|
|
|
|
# https://stackoverflow.com/a/246128/3549270
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
time docker run --rm -it \
|
|
-w /app \
|
|
-v "${SCRIPT_DIR}/../target/checkouts:/app/checkouts" \
|
|
-v "${SCRIPT_DIR}/../target/ecosystem_fix_all_results:/app/ecosystem_fix_all_results" \
|
|
-v "${SCRIPT_DIR}/../target/release/ruff:/app/ruff" \
|
|
-v "${SCRIPT_DIR}/../ecosystem_all.py:/app/ecosystem_all.py" \
|
|
-v "${SCRIPT_DIR}/../github_search.jsonl:/app/github_search.jsonl" \
|
|
-v "${SCRIPT_DIR}/../.venv-3.11:/app/.venv" \
|
|
-v "${SCRIPT_DIR}/ecosystem_fix_all_check_entrypoint.sh:/app/ecosystem_fix_all_check_entrypoint.sh" \
|
|
-v "${SCRIPT_DIR}/ecosystem_fix_all_check.py:/app/ecosystem_fix_all_check.py" \
|
|
python:3.11 ./ecosystem_fix_all_check_entrypoint.sh
|
|
|
|
# grep the autofix errors
|
|
grep -R "the rule codes" "${SCRIPT_DIR}/../target/ecosystem_fix_all_results" | sort > "${SCRIPT_DIR}/../target/autofix-errors.txt"
|
|
# Make sure we didn't have an early exit
|
|
echo "Done"
|