Skip to content

Create GH action for code formatting#223

Merged
arjunsuresh merged 7 commits intodevfrom
anandhu-eng-patch-1
Apr 14, 2026
Merged

Create GH action for code formatting#223
arjunsuresh merged 7 commits intodevfrom
anandhu-eng-patch-1

Conversation

@anandhu-eng
Copy link
Copy Markdown
Contributor

✅ PR Checklist

  • Target branch is dev

📌 Note: PRs must be raised against dev. Do not commit directly to main.

✅ Testing & CI

  • Have tested the changes in my local environment, else have properly conveyed in the PR description
  • The change includes a GitHub Action to test the script(if it is possible to be added).
  • No existing GitHub Actions are failing because of this change.

📚 Documentation

  • README or help docs are updated for new features or changes.
  • CLI help messages are meaningful and complete.

📁 File Hygiene & Output Handling

  • No unintended files (e.g., logs, cache, temp files, pycache, output folders) are committed.

🛡️ Safety & Security

  • No secrets or credentials are committed.
  • Paths, shell commands, and environment handling are safe and portable.

🙌 Contribution Hygiene

  • PR title and description are concise and clearly state the purpose of the change.
  • Related issues (if any) are properly referenced using Fixes # or Closes #.
  • All reviewer feedback has been addressed.

@anandhu-eng anandhu-eng requested a review from a team as a code owner April 6, 2026 06:21
@anandhu-eng anandhu-eng marked this pull request as draft April 6, 2026 06:22
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

🤖 AI PR Review Summary\n\nAdds a GitHub Actions workflow to automatically format Python files on every push, excluding commits made by the automation bot itself. The workflow installs autopep8, formats modified Python files, and commits any changes back to the repository. Risks include potential conflicts or unintended formatting changes that may disrupt ongoing work. The design relies on a GitHub App token for authentication and uses a simple diff-based file filter, which may miss edge cases such as renamed or deleted files.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

🤖 AI PR Review Summary\n\nThis PR updates the CLA workflow to expand the allowlist for automated users and introduces a new GitHub Actions workflow for automatic Python code formatting using autopep8. The formatting workflow runs on all branches except when triggered by the mlc-automations user, installs dependencies, formats changed Python files, and commits any changes back to the repo. Risks include potential unintended commits if formatting changes are applied unexpectedly and possible permission issues with the GitHub token. The design is straightforward but could benefit from additional safeguards and clearer filtering of files to format.

@anandhu-eng anandhu-eng marked this pull request as ready for review April 14, 2026 13:30
@anandhu-eng anandhu-eng requested a review from a team as a code owner April 14, 2026 13:30
@github-actions
Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nThis PR adds an allowlist entry for 'mlc-automations' in the CLA check workflow and introduces a new GitHub Actions workflow for automatic Python code formatting using autopep8. The formatting workflow runs on all branches except when triggered by the 'mlc-automations' actor to avoid recursion. It checks for modified Python files, formats them, and commits the changes automatically. Risks include potential unintended commits if the formatting changes are not desired, and the use of git commands in the workflow requires careful permission handling. The design is straightforward but could benefit from additional safeguards such as limiting the scope of files or adding a dry-run mode.

@github-actions
Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nThis PR introduces a new GitHub workflow for automatic Python code formatting using autopep8, and updates the CLA workflow to extend the allowlist. The main code changes in mlc/action.py focus on code cleanup, formatting improvements, and minor refactoring without changing core logic. Risks are low as no functional changes are introduced, but the new formatting workflow could cause unexpected formatting commits if not properly tested. Design-wise, the formatting workflow is gated to exclude the automation bot itself to avoid infinite loops, which is a good practice.

@github-actions
Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nThis PR adds a new GitHub workflow for automatic Python code formatting using autopep8 and updates the CLA workflow to include an additional user in the allowlist. It also refactors the Action class in mlc/action.py for improved readability and consistency, including better logging, formatting, and minor code style improvements. The risks are low as the changes are mostly additive and stylistic, but the new formatting workflow could cause unexpected commits if autopep8 modifies files unexpectedly. The design is straightforward, but the formatting workflow assumes the presence of Python files and may need further testing to ensure it does not interfere with other workflows.

@github-actions
Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nThis PR adds a new GitHub workflow for automatic Python code formatting using autopep8 and updates the CLA workflow to include an additional user in the allowlist. The main code changes in mlc/action.py improve code formatting, add comments, and refactor some logic for clarity and consistency. The risks are low as the formatting workflow runs conditionally and the code changes are mostly stylistic and minor refactors. However, the new formatting workflow commits directly to branches which could cause unexpected pushes if not carefully monitored. There are no major design issues, but some minor improvements in logging and error handling could be considered.

@github-actions
Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nThis PR introduces a new GitHub workflow for automatic Python code formatting using autopep8, updates the CLA workflow to include an additional allowlist user, and performs a version bump to 1.2.0. The main code changes in mlc/action.py include code style improvements, enhanced logging, and minor refactoring for readability and consistency. Risks include potential issues with the new formatting workflow committing changes automatically, which might conflict with ongoing PRs or cause unexpected commits. The Action class changes appear low risk but should be tested for backward compatibility and correct behavior in repo loading and item management.

@arjunsuresh arjunsuresh merged commit 3f8a2b9 into dev Apr 14, 2026
55 of 58 checks passed
@arjunsuresh arjunsuresh deleted the anandhu-eng-patch-1 branch April 14, 2026 18:10
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants