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

single word constant variables trigger snake case error #11

Closed
maurelian opened this issue Nov 16, 2017 · 2 comments
Closed

single word constant variables trigger snake case error #11

maurelian opened this issue Nov 16, 2017 · 2 comments
Milestone

Comments

@maurelian
Copy link
Contributor

contract Token {
    string constant name = " Token";
    string constant symbol = "TOK";
    uint8 constant decimals = 18;

Each of the constant declarations has the constant name must be in SNAKE_CASE error.

Capitalizing the names removes the error. But snake case doesn't say anything about being capitalized.

Also, I don't see anything about it in the style guide: https://solidity.readthedocs.io/en/develop/style-guide.html

@idrabenia
Copy link
Contributor

idrabenia commented Nov 17, 2017

Hi @maurelian ,

Thanks for your feedback!

There is from Style Guide

Constants
Constants should be named with all capital letters with underscores separating words. 
Examples: MAX_BLOCKS, TOKEN_NAME, TOKEN_TICKER, CONTRACT_VERSION.

I corrected the message. But if execution of this rule is not suitable for you - it's possible to disable the rule in configuration file:

"rules": {
    ...
    "const-name-snakecase": false,
    ...
}

It's your own choice.

Thanks!
- Ilya

@idrabenia idrabenia added this to the v1.1.9 milestone Nov 17, 2017
@maurelian
Copy link
Contributor Author

Ahh, thank you for pointing that out. I had just done a search for the word snake_case in the style guide and came up with nothing.

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

No branches or pull requests

2 participants