Skip to content
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

feat: add cairo-lint ci #238

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

okhaimie-dev
Copy link
Contributor

@okhaimie-dev okhaimie-dev commented Oct 1, 2024

Added cairo-lint to the ci pipeline

Copy link

vercel bot commented Oct 1, 2024

@okhaimie-dev is attempting to deploy a commit to the keep-starknet-strange Team on Vercel.

A member of the Team first needs to authorize it.

run: cargo install scarb-cairo-lint --git https://github.com/keep-starknet-strange/cairo-lint

- uses: asdf-vm/actions/install@v3
- run: scarb cairo-lint
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking the CI check should fail if there are existing Cairo-lint warnings. What do you think?

Copy link
Contributor Author

@okhaimie-dev okhaimie-dev Oct 5, 2024

Choose a reason for hiding this comment

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

I am not sure about this, there are some linting warning I don't think we might want to follow.

Example:

warning: Plugin diagnostic: Leaving `panic!` in the code is discouraged.
  --> /home/runner/work/shinigami/shinigami/packages/engine/src/cond_stack.cairo:90:18
   |
90 |             _ => panic!("Invalid condition")

I think there are some valid panics, so if this type fails might not be the desired result

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll see if there is a way to ignore lints, but I think all the existing lints we want to follow. Even the panic one, we don't want any panic conditions ( and this branch should never be reached anyway ).


- uses: asdf-vm/actions/install@v3
- run: scarb cairo-lint
- run: scarb cairo-lint --fix
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this run needed? The changes wouldn't persist to the branch right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was also thinking to remove the run: scarb cairo-lint --fix but wanted to here your feedback on this

@b-j-roberts
Copy link
Contributor

Hey, shouldn't the cairo-lint CI be failing here due to the existing lint warnings?

@bloomingpeach bloomingpeach mentioned this pull request Nov 2, 2024
3 tasks
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.

2 participants