Skip to content

Add CI lint gate and local precheck command#1122

Merged
sbryngelson merged 16 commits intoMFlowCode:masterfrom
sbryngelson:triage
Feb 5, 2026
Merged

Add CI lint gate and local precheck command#1122
sbryngelson merged 16 commits intoMFlowCode:masterfrom
sbryngelson:triage

Conversation

@sbryngelson
Copy link
Member

@sbryngelson sbryngelson commented Feb 4, 2026

User description

User description

Summary

  • Add lint-gate job to test.yml that runs fast checks (formatting, spelling, linting) before expensive test matrix and HPC jobs start
  • Add concurrency groups to test.yml, coverage.yml, cleanliness.yml, and bench.yml to cancel superseded runs on new pushes
  • Add ./mfc.sh precheck command for local CI validation before pushing

Motivation

  1. Prevent wasted CI resources: Expensive HPC and test matrix jobs won't start if basic lint checks fail
  2. Faster feedback: Developers know within ~1-2 minutes if their code has formatting/lint issues
  3. Cancel superseded runs: New pushes cancel in-progress runs on the same branch
  4. Local validation: ./mfc.sh precheck lets developers catch issues before pushing

Test plan

  • Verify ./mfc.sh precheck runs locally and catches formatting issues
  • Verify lint-gate job runs before test matrix in CI
  • Verify concurrency cancellation works on rapid pushes

Generated with Claude Code

PR Type

Enhancement, Tests

Description

  • Add lint-gate CI job running fast checks before expensive tests

  • Add ./mfc.sh precheck command for local pre-push validation

  • Implement concurrency groups to cancel superseded CI runs

  • Lint-gate checks formatting, spelling, toolchain, and source code

Diagram Walkthrough

flowchart LR
  A["Developer Code"] -->|"./mfc.sh precheck"| B["Local Validation"]
  B -->|"Pass"| C["Push to Branch"]
  C -->|"Trigger CI"| D["lint-gate Job"]
  D -->|"Pass"| E["Test Matrix & HPC"]
  D -->|"Fail"| F["Cancel Expensive Jobs"]
  B -->|"Fail"| G["Fix Issues Locally"]
Loading

File Walkthrough

Relevant files
Enhancement
mfc.sh
Add precheck command entry point                                                 

mfc.sh

  • Add new precheck command branch that sources precheck.sh script
  • Follows same pattern as existing spelling and lint commands
  • Requires Python bootstrap initialization
+4/-0     
precheck.sh
Implement local precheck validation script                             

toolchain/bootstrap/precheck.sh

  • New script implementing local CI validation with 4 sequential checks
  • Checks formatting, spelling, toolchain lint, and source code patterns
  • Detects raw OpenACC/OpenMP directives, double precision intrinsics,
    and junk code
  • Supports parallel jobs option (-j) for formatting check
  • Provides colored output and detailed error messages
+118/-0 
test.yml
Add lint-gate job and concurrency configuration                   

.github/workflows/test.yml

  • Add concurrency group to cancel superseded runs on new pushes
  • Add new lint-gate job running 5 fast checks before test matrix
  • Lint-gate checks formatting, spelling, toolchain lint, raw directives,
    double precision intrinsics, and junk code patterns
  • Make github and self jobs depend on lint-gate completion
  • Expensive test matrix and HPC jobs only start after lint-gate passes
+45/-3   
Configuration changes
coverage.yml
Add concurrency group configuration                                           

.github/workflows/coverage.yml

  • Add concurrency group to cancel superseded runs on new pushes
  • Uses workflow name and git ref to group concurrent runs
+4/-0     
cleanliness.yml
Add concurrency group configuration                                           

.github/workflows/cleanliness.yml

  • Add concurrency group to cancel superseded runs on new pushes
  • Uses workflow name and git ref to group concurrent runs
+4/-0     
bench.yml
Add concurrency group configuration                                           

.github/workflows/bench.yml

  • Add concurrency group to cancel superseded runs on new pushes
  • Uses workflow name and git ref to group concurrent runs
+4/-0     

CodeAnt-AI Description

Run CI lint gate locally and block expensive CI/benchmarks until fast checks pass

What Changed

  • Add a new local precheck command (mfc.sh precheck) that runs formatting, spelling, toolchain lint, and basic source checks; it fails if formatting auto-changed files or if any checks fail
  • Install and run a git pre-commit hook that invokes the precheck to block commits (can be bypassed with --no-verify); auto-installs on first mfc.sh invocation
  • CI now runs a fast "Lint Gate" job before the full test matrix; test and benchmark jobs wait for Lint Gate success and tests to complete before starting
  • Add concurrency groups across workflows so superseded runs on the same branch are cancelled automatically
  • Auto-install tab completions on first run and update installed completions when regenerated; zsh/bash completion behavior improved and help text clarified for debug/verbosity flags

Impact

✅ Fewer wasted HPC/benchmark runs
✅ Shorter pre-push feedback loop (catch formatting/lint locally)
✅ Fewer redundant CI runs on rapid pushes

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features

    • Local "precheck" command to run formatting, spelling, lint and source checks (parallel jobs supported).
    • Installable pre-commit hook that runs precheck before commits.
    • Automatic installation/updating of shell completions with prompts to reload the shell.
    • CI "Wait for Test Suite" step that polls test/lint outcomes and enforces timeouts; new lint-gate phase.
  • Chores

    • CI workflows now use concurrency with cancel-in-progress; job dependency ordering updated so checks run earlier and block downstream jobs.
  • Documentation

    • Improved CLI help text and option descriptions; completion behavior tweaks.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 3/5 size:L This PR changes 100-499 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

2 participants