Skip to content

feat: add cairo-lint ci#238

Open
okhaimie-dev wants to merge 5 commits intostarkware-bitcoin:mainfrom
okhaimie-dev:cairo-lint
Open

feat: add cairo-lint ci#238
okhaimie-dev wants to merge 5 commits intostarkware-bitcoin:mainfrom
okhaimie-dev:cairo-lint

Conversation

@okhaimie-dev
Copy link
Copy Markdown
Contributor

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

Added cairo-lint to the ci pipeline

@vercel
Copy link
Copy Markdown

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.

Comment thread .github/workflows/check.yml Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 ).

Comment thread .github/workflows/check.yml Outdated

- uses: asdf-vm/actions/install@v3
- run: scarb cairo-lint
- run: scarb cairo-lint --fix
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.

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@dlaciport dlaciport 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