chore: format python in aitk#429
Open
xieofxie wants to merge 3 commits into
Open
Conversation
added 2 commits
May 25, 2026 14:28
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes Python formatting across multiple AITK recipe scripts and replaces the previous auto-formatting approach with a Ruff-based lint/format step integrated into the .aitk/scripts/sanitize.py entrypoint.
Changes:
- Reformat many AITK Python scripts (imports, whitespace, line wrapping, dict/list formatting).
- Replace the removed
auto_formatter.pypath with a newruff_check.pyhelper and addruffto.aitk/scripts/requirements.txt. - Minor cleanup tweaks across workflows/evaluation helpers (e.g., trailing commas, consistent quoting, small refactors from formatting).
Reviewed changes
Copilot reviewed 62 out of 65 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sd2-community-stable-diffusion-2-1/aitk/sd_utils/qdq.py | Import ordering/whitespace formatting. |
| sd2-community-stable-diffusion-2-1/aitk/sd_utils/ov.py | Import cleanup + formatting (dict formatting/trailing commas). |
| sd2-community-stable-diffusion-2-1/aitk/sd_utils/ort.py | Formatting of long calls / whitespace cleanup. |
| sd2-community-stable-diffusion-2-1/aitk/sd_utils/onnx_patch.py | Import ordering + whitespace cleanup. |
| sd2-community-stable-diffusion-2-1/aitk/sd_qnn_workflow.py | Formatting + subprocess invocation wrapping. |
| sd2-community-stable-diffusion-2-1/aitk/sd_qnn_evaluation.py | Formatting + consistent quoting/trailing commas. |
| sd2-community-stable-diffusion-2-1/aitk/sd_ov_workflow.py | Formatting + subprocess invocation wrapping. |
| sd2-community-stable-diffusion-2-1/aitk/sd_ov_evaluation.py | Formatting + consistent quoting/trailing commas. |
| sd2-community-stable-diffusion-2-1/aitk/evaluation.py | Comment formatting cleanup. |
| sd-legacy-stable-diffusion-v1-5/aitk/sd_utils/qdq.py | Import ordering/whitespace formatting. |
| sd-legacy-stable-diffusion-v1-5/aitk/sd_utils/ov.py | Import cleanup + formatting (dict formatting/trailing commas). |
| sd-legacy-stable-diffusion-v1-5/aitk/sd_utils/ort.py | Formatting of long calls / whitespace cleanup. |
| sd-legacy-stable-diffusion-v1-5/aitk/sd_utils/onnx_patch.py | Import ordering + whitespace cleanup. |
| sd-legacy-stable-diffusion-v1-5/aitk/sd_qnn_workflow.py | Formatting + subprocess invocation wrapping. |
| sd-legacy-stable-diffusion-v1-5/aitk/sd_qnn_evaluation.py | Formatting + consistent quoting/trailing commas. |
| sd-legacy-stable-diffusion-v1-5/aitk/sd_ov_workflow.py | Formatting + subprocess invocation wrapping. |
| sd-legacy-stable-diffusion-v1-5/aitk/sd_ov_evaluation.py | Formatting + consistent quoting/trailing commas. |
| sd-legacy-stable-diffusion-v1-5/aitk/evaluation.py | Comment formatting cleanup. |
| sam2.1-hiera-small/aitk/sam2_qnn_workflow.py | Formatting + subprocess invocation wrapping; import ordering. |
| sam2.1-hiera-small/aitk/sam2_qnn_evaluation.py | Formatting + import ordering; line wrapping. |
| sam2.1-hiera-small/aitk/sam2_mask_generator.py | Formatting + import cleanup and line wrapping. |
| sam2.1-hiera-small/aitk/generate_model.py | Formatting of torch.onnx.export calls. |
| sam-vit-base/aitk/user_script.py | Import ordering formatting. |
| sam-vit-base/aitk/sam_qnn_workflow.py | Formatting + subprocess invocation wrapping; import ordering. |
| sam-vit-base/aitk/sam_qnn_evaluation.py | Formatting + consistent quoting/trailing commas. |
| sam-vit-base/aitk/sam_mask_generator.py | Formatting + import cleanup and line wrapping. |
| sam-vit-base/aitk/model_patches.py | Formatting of keyword arguments spacing. |
| sam-vit-base/aitk/config.py | Whitespace formatting. |
| openai-whisper-large-v3-turbo/aitk/whisper_encoder_load.py | Import ordering + line wrapping. |
| openai-whisper-large-v3-turbo/aitk/whisper_decoder_load.py | Import ordering + line wrapping. |
| openai-whisper-large-v3-turbo/aitk/qnn_workflow.py | Formatting + subprocess invocation wrapping; minor string formatting cleanup. |
| openai-whisper-large-v3-turbo/aitk/qnn_run.py | Import ordering + formatting; small comment formatting. |
| openai-whisper-large-v3-turbo/aitk/qnn_evaluate.py | Formatting + import ordering; dict formatting. |
| openai-whisper-large-v3-turbo/aitk/qnn_app.py | Formatting of session initialization calls. |
| openai-whisper-large-v3-turbo/aitk/ov_workflow.py | Formatting + subprocess invocation wrapping. |
| openai-whisper-large-v3-turbo/aitk/ov_evaluate.py | Formatting + minor indentation cleanup and line wrapping. |
| openai-whisper-large-v3-turbo/aitk/convert_whisper_to_ovir.py | Formatting and line wrapping; consistent quoting; small helper refactors (layout only). |
| openai-clip-vit-large-patch14/aitk/user_script.py | Import ordering formatting. |
| openai-clip-vit-large-patch14/aitk/openai_clip_ov.py | Import ordering + minor function signature formatting. |
| openai-clip-vit-base-patch32/aitk/user_script.py | Import ordering formatting. |
| openai-clip-vit-base-patch32/aitk/openai_clip_ov.py | Import ordering + minor function signature formatting. |
| openai-clip-vit-base-patch16/aitk/user_script.py | Import ordering formatting. |
| openai-clip-vit-base-patch16/aitk/openai_clip_ov.py | Import ordering + minor function signature formatting. |
| OFA-Sys-chinese-clip-vit-base-patch16/aitk/openai_clip_ov.py | Import ordering + consistent quoting + line wrapping. |
| microsoft-resnet-50/aitk/imagenet.py | Import cleanup + formatting; minor condition formatting. |
| microsoft-resnet-50/aitk/imagenet-qnn-gpu.py | Import ordering formatting. |
| laion-CLIP-ViT-B-32-laion2B-s34B-b79K/aitk/user_script.py | Import ordering formatting. |
| laion-CLIP-ViT-B-32-laion2B-s34B-b79K/aitk/laion_clip_ov.py | Import ordering + minor function signature formatting. |
| intel-bert-base-uncased-mrpc/aitk/user_script.py | Import ordering formatting. |
| google-vit-base-patch16-224/aitk/vit-base-patch16-224.py | Import cleanup + formatting; minor condition formatting. |
| google-bert-bert-base-multilingual-cased/aitk/user_script.py | Formatting + line wrapping of dataset loading call. |
| .aitk/scripts/sanitize/parameters.py | Formatting for long json.dumps call. |
| .aitk/scripts/sanitize/model_parameter.py | Formatting of long conditionals and function calls. |
| .aitk/scripts/sanitize/generator_qnn.py | Fix invalid f-string formatting + import ordering. |
| .aitk/scripts/sanitize/generator_intel.py | Fix invalid f-string formatting + import ordering. |
| .aitk/scripts/sanitize/generator_amd.py | Fix invalid f-string formatting + import ordering. |
| .aitk/scripts/sanitize/file_validation.py | Consistent quoting in error message. |
| .aitk/scripts/sanitize.py | Switch to Ruff-based formatting/check integration. |
| .aitk/scripts/ruff_check.py | New Ruff lint/format runner for .aitk/ and */aitk/. |
| .aitk/scripts/requirements.txt | Pin script dependencies and add Ruff. |
| .aitk/scripts/requirements_check.py | Minor whitespace formatting. |
| .aitk/scripts/project_processor.py | Formatting-only changes (sorting lambdas, slicing spacing, line wrapping). |
| .aitk/scripts/install_freeze.py | Remove unused variable assignment from subprocess.run. |
| .aitk/scripts/bump_model_versions.py | Minor slicing/whitespace formatting. |
| .aitk/scripts/auto_formatter.py | Removed (replaced by Ruff-based approach). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ziyuanguo1998
approved these changes
May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ipynb will be included later