Skip to content

Added lint-check.yml to fail pr when user does not run make check before making a pr - #207

Open
ariana-r-chowdhury wants to merge 2 commits into
developfrom
183-Add-formatting-to-CI
Open

ariana-r-chowdhury wants to merge 2 commits into
developfrom
183-Add-formatting-to-CI

Conversation

@ariana-r-chowdhury

Copy link
Copy Markdown

Issue #183

I modeled this following UTD Trends' lint check. The workflow runs when a pull
request is made to develop (and on pushes to develop, or manually). It
runs on ubuntu-latest with these steps:

  • Checkout: downloads my code onto the robot
  • Set up Go: installs Go 1.26
  • Setup: runs make setup to install staticcheck and goimports
  • Check: runs make check
  • Fail if files changed: runs git diff --exit-code. If make check had
    to change any file, the check fails.

I had never worked with GitHub workflows before, so this was a big learning step. I used GitHub's "Creating an example workflow" docs to understand how a workflow operates, as well as checked out the api-tools workflow to better understand what is needed to solve this issue.

@ariana-r-chowdhury
ariana-r-chowdhury requested review from a team as code owners October 13, 2026 23:36
@justinschwerdtfeger

Copy link
Copy Markdown
Contributor

Woah! This is great! I'm checking it out rn

@justinschwerdtfeger justinschwerdtfeger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great!

git diff is a great way to check for changes!

Small tweak:
Lets copy this over to our existing go.yml instead of running a new github action

@ariana-r-chowdhury

Copy link
Copy Markdown
Author

Thanks! I will do that by this afternoon and submit another pr.

@mikehquan19

Copy link
Copy Markdown
Contributor

You just need to push update commit. Pr will auto-update :)

@ariana-r-chowdhury

ariana-r-chowdhury commented Oct 14, 2026 •

Copy link
Copy Markdown
Author

I added the "Fail if files changed" step (git diff --exit-code) to go.yml
in the build_Ubuntu job right after make check, and removed the separate
lint-check.yml.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants