Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Add formatting step to CI - #120

Merged
lukehinds merged 1 commit into
mainfrom
ci--add
Nov 28, 2024
Merged

lukehinds merged 1 commit into
mainfrom
ci--add

Conversation

@poppysec

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: poppysec <poppaea@stacklok.com>
@poppysec
poppysec requested a review from lukehinds November 28, 2024 15:45
Comment thread .github/workflows/ci.yml
- name: Run linting
run: make lint

- name: Run formatting

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.

should we make the CI step explicitly fail if there are any changes afterwards?

if [[ -n "$(git status --porcelain)" ]]; then
          echo "Formatting produced changes. Please run 'make format' locally and commit the changes."
          exit 1
        fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it might actually fail is , should do a sys.exit code of 1, but I will check

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ah no, it also formats it as well!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So this will automatically format everything in the PR, unless that command fails, at which point CI will fail too.

Comment thread .github/workflows/ci.yml
- name: Run linting
run: make lint

- name: Run formatting

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ah no, it also formats it as well!

@lukehinds
lukehinds merged commit b8a6e80 into main Nov 28, 2024
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