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

Feature Request: enable overrides in .solhint.json #359

Open
amusingaxl opened this issue Oct 28, 2022 · 2 comments
Open

Feature Request: enable overrides in .solhint.json #359

amusingaxl opened this issue Oct 28, 2022 · 2 comments

Comments

@amusingaxl
Copy link

Most linters out there support overrides for specific file patterns.

For instance, eslint has supported this for a long time.

One use case that I currently have is that I want slightly different ruleset for Solidity test files.

It would be awesome if we could have something like:

{
  "extends": "solhint:recommended",
  "plugins": [
    "prettier"
  ],
  "rules": {
    "prettier/prettier": "warn"
  },
  "overrides": [
    {
      "files": "**/*.t.sol",
      "rules": {
        "max-state-count": "off",
        "state-visibility": "off"
      }
    }
  ]
}

With the configs above we can reduce the error/warning clutter and also improve the signal-to-noise ratio in test files, so we can write:

    RwaUrn urn;
    RwaOutputConduit outC;
    RwaInputConduit inC;

instead of:

    RwaUrn internal urn;
    RwaOutputConduit internal outC;
    RwaInputConduit internal inC;

without being bothered with errors.

Right now the workaround is to have 2 separate .solhint*.json files and run the 2 tasks separately. It can be a bit tedious to add the required boilerplate every time though.

@dbale-altoros
Copy link
Collaborator

@amusingaxl
Sorry the late response and thanks a lot for your feedback
We are going to keep solhint updated on regular basis and this could be a good addition
Not sure when can we add this because it is not a simple addition, but I see the point of it.

Thanks a lot!

@alxiong
Copy link

alxiong commented Oct 27, 2023

feature request seconded!

This feature is particularly useful when someone is using forge and solhint as the same time and trying to follow forge's somewhat arbitrary snake_camelCases for contract/function name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants