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

Linter: Replace GIT_REV with GIT_BRANCH #1552

Open
cmichi opened this issue Mar 21, 2024 · 0 comments
Open

Linter: Replace GIT_REV with GIT_BRANCH #1552

cmichi opened this issue Mar 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@cmichi
Copy link
Collaborator

cmichi commented Mar 21, 2024

When the linter is run for a contract, we fetch the lints at this commit from the ink! repo:

    /// Git repository with ink_linting libraries
    pub const GIT_URL: &str = "https://github.com/paritytech/ink/";
    /// Git revision number of the linting crate
    pub const GIT_REV: &str = "b6880dd9384e09ec4e7ad65453cd844113e8a316";

(source)

I think what we should do instead:

  • Read the MAJOR ink version from the contract's Cargo.toml
  • Take that number (e.g. 5) and form it into v5.x.x
  • Fetch the lints from the ink repository at the branch v5.x.x, instead of at a fixed GIT_REV

Right now, the linter uses the lints from GIT_REV for a contract of an arbitrary ink version. It's more future proof to have it fetch the lints for that particular ink! version. Also, we won't have to update cargo-contract any time we release new lints for an ink! version.

@cmichi cmichi added the enhancement New feature or request label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant