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

Improve clarinet's clarity linter #1105

Open
smcclellan opened this issue Jul 27, 2023 · 1 comment
Open

Improve clarinet's clarity linter #1105

smcclellan opened this issue Jul 27, 2023 · 1 comment
Labels

Comments

@smcclellan
Copy link
Contributor

Linting rules can be configured to be “off”, “info”, “warning” or “error”.
Default value is indicated here between parenthesis.

  • dead code
    • unused constant (warning)
    • unused function parameter (warning)
    • unused let binding (warning)
    • unused private function (warning)
  • unsafe
    • avoid unwrap-panic (warning)
    • avoid unwrap-err-panic (warning)
  • prefer native function aliases (introduced in clarity 2 and versions to come)
    • prefer element-at? (instead of element-at) (warning)
    • prefer index-of? (instead of index-of) (warning)
    • prefer bit-xor (instead of xor) (warning)
  • convention
    • invalid naming case (info)
@obycode
Copy link
Member

obycode commented Jun 4, 2024

We could also add a check for a function that is defined as public but could be readonly. It should always be preferred to make the function read-only if it doesn't need to modify any state so that it is clear that it can be called via the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants