-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,21 @@ jobs: | |
mdl -s .github/linter/readme_style.rb README.md | ||
mdl -s .github/linter/base_style.rb .github | ||
|
||
cairo-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rust nightly | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt, clippy | ||
- name: Install cairo-lint | ||
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 | ||
- run: scarb cairo-lint --fix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was also thinking to remove the |
||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
I think there are some valid panics, so if this type fails might not be the desired result
There was a problem hiding this comment.
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 ).