Skip to content

Add CI checks for formatting + clean up CI #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 17, 2025

Conversation

strickvl
Copy link
Contributor

@strickvl strickvl commented May 17, 2025

Code Formatting and CI Improvements

This PR makes several improvements to code quality and CI/CD workflows:

🧹 Code Formatting Fixes

Fixed various code quality issues across the repository:

  • Removed unused variables (F841) in multiple projects:

    • gamesense/steps/log_metadata.py
    • llm-complete-guide/steps/populate_index.py and utils/llm_utils.py
    • magic-photobooth/frontend.py and modal_run_using_azure_data.py
    • zencoder/pipelines/generate_code_dataset.py and steps/deployment.py
    • zencoder/test_zencoder.py
    • zenml-support-agent/steps/agent_creator.py
    • and other files with minor fixes
  • Fixed syntax error in zencoder/test_starcoder_bigcode.py

🔧 CI/CD Improvements

Enhanced CI/CD pipeline for better code quality:

  • Added new GitHub Actions workflow (code-formatting.yml) that runs the formatting script
  • Workflow checks if code meets formatting standards and fails if any changes are needed
  • Updated pull_request.yml to include the new formatting check
  • Ensures PRs cannot be merged until code passes formatting checks
  • Removed unused/outdated CI workflows:
    • gpt4_summarizer.yml
    • production_run_complete_llm.yml
    • staging_run_complete_llm.yml

📝 Tool Configuration Updates

  • Modified scripts/format.sh to exclude .ipynb files from linting checks
  • Added .claude/ directory to .gitignore

This PR ensures that future contributions maintain consistent code formatting standards, making the codebase more maintainable and reducing noise in code reviews.

Commit History

  • 58cb890 - Format files with latest ruff
  • a029351 - Add .claude/ to gitignore
  • 0a17913 - Fix unused variables and add notebook exclusion to format script
  • a02a30b - remove unused CI workflows
  • ec67513 - Add code formatting CI workflow

strickvl and others added 2 commits May 17, 2025 18:53
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

dagshub bot commented May 17, 2025

strickvl and others added 2 commits May 17, 2025 19:04
- Fix unused variables across multiple Python files
- Fix syntax error in zencoder/test_starcoder_bigcode.py
- Exclude Jupyter notebooks from linting checks in format.sh

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@strickvl strickvl changed the title Add CI checks for formatting Add CI checks for formatting + clean up CI May 17, 2025
- Created new GitHub Actions workflow 'code-formatting.yml' that runs the formatting script
- Workflow checks if code meets formatting standards and fails if any changes are needed
- Updated pull_request.yml to include the new formatting check
- Ensures PRs cannot be merged until code passes formatting checks
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances CI workflows by adding automated formatting checks, removes outdated CI files, and applies consistent code formatting fixes across the codebase.

  • Updated scripts/format.sh to exclude Jupyter notebooks from linting and introduced a GitHub Actions workflow to enforce formatting
  • Removed deprecated CI workflows and updated pull_request.yml to include the new formatting check
  • Standardized multiline return type annotations and cleaned up unused variables/imports in various pipeline and utility modules

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/format.sh Exclude *.ipynb in ruff checks
retail-forecast/pipelines/training_pipeline.py Normalize multiline return type annotation
magic-photobooth/modal_run_using_azure_data.py Normalize return type annotation, discard unused load_data
magic-photobooth/modal_run.py Normalize return type annotation
magic-photobooth/k8s_run.py Normalize return type annotation
magic-photobooth/frontend.py Removed assignment from st.selectbox
llm-complete-guide/utils/llm_utils.py Removed unused source-variable logic and query construction
llm-complete-guide/steps/populate_index.py Removed unused bucket_ranges list
llm-complete-guide/steps/hf_dataset_loader.py Normalize multiline return type annotation
llm-complete-guide/steps/eval_retrieval.py Normalize multiline return type annotations
huggingface-sagemaker/steps/promotion/promote_get_metrics.py Normalize multiline return type annotation
huggingface-sagemaker/steps/deploying/huggingface_deployment.py Adjust multiline assert formatting
gamesense/steps/log_metadata.py Remove unused import and replace unused var with discard _
databricks-production-qa-demo/steps/deployment/deployment_deploy.py Normalize multiline return type annotation
.github/workflows/staging_run_complete_llm.yml Removed outdated workflow
.github/workflows/pull_request.yml Renamed workflow and added code-formatting-check
.github/workflows/production_run_complete_llm.yml Removed outdated workflow
.github/workflows/gpt4_summarizer.yml Removed outdated workflow
.github/workflows/code-formatting.yml Added new formatting CI workflow

@strickvl
Copy link
Contributor Author

@AlexejPenner I removed the CI yaml files as we weren't using them and it was just adding noise. Hope that's ok!

@strickvl strickvl added enhancement New feature or request internal CI/CD labels May 17, 2025
@strickvl strickvl merged commit a2410ff into main May 17, 2025
4 of 5 checks passed
@strickvl strickvl deleted the ci/force-formatting-gh-actions branch May 17, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD enhancement New feature or request internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants