Skip to content
Open
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
80 changes: 0 additions & 80 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,83 +35,3 @@ jobs:

- name: Run Ruff linter
run: ruff check . --output-format=github

# Optional: Create a comment on PR with formatting suggestions
ruff-suggestions:
if: github.event_name == 'pull_request' && failure()
needs: ruff
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Ruff
run: pip install ruff

- name: Generate fix suggestions
run: |
echo "## 🎨 Ruff Formatting & Linting Report" >> suggestions.md
echo "" >> suggestions.md
echo "Run the following commands locally to fix issues:" >> suggestions.md
echo "" >> suggestions.md
echo '```bash' >> suggestions.md
echo "ruff format ." >> suggestions.md
echo "ruff check . --fix" >> suggestions.md
echo '```' >> suggestions.md
echo "" >> suggestions.md

# Show what would be changed
echo "### Formatting changes needed:" >> suggestions.md
echo '```diff' >> suggestions.md
ruff format --check . --diff >> suggestions.md 2>&1 || true
echo '```' >> suggestions.md
echo "" >> suggestions.md

# Show linting issues
echo "### Linting issues:" >> suggestions.md
echo '```' >> suggestions.md
ruff check . >> suggestions.md 2>&1 || true
echo '```' >> suggestions.md

- name: Comment PR
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const suggestions = fs.readFileSync('suggestions.md', 'utf8');

// Find existing comment
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('🎨 Ruff Formatting & Linting Report')
);

if (botComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: suggestions
});
} else {
// Create new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: suggestions
});
}