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] Add compiler warnings (or errors) for usage of inappropriate case #1019

Open
1 task done
gryznar opened this issue Oct 8, 2023 · 0 comments
Open
1 task done
Labels
enhancement New feature or request mojo Issues that are related to mojo mojo-lang Tag for all issues related to language. mojo-repo Tag all issues with this label

Comments

@gryznar
Copy link
Contributor

gryznar commented Oct 8, 2023

Review Mojo's priorities

What is your request?

I would suggest to add warnings (or errors possible to turn off via flag) to the compiler related to usage of inappropriate case in source code (camelCase instead of snake_case and so on)

What is your motivation for this change?

This feature will greatly help to keep entire Mojo codebase consistent and avoid mess as is still in Python (despite PEP8) and which is not fixable because of huge compatibility reasons:
image
Of course, if compiler will suffer from this additional job, this may be moved to formatting tool, but keeping that in the compiler would have few advantages:

  • formater is optional, not everyone will use that, while using compiler is essential
  • warning from compiler would point directly, that this should be fixed (feedback from formater may be threaten as suggestions)
  • people which come from another language would have information directly without need of using external resources

Rust already has that feature in its compiler, so it is doable :)
image

Any other details?

As for now this is a noticeable problem. People who start to develop projects in Mojo are not aware that snake_case is only one supported convention. The sooner it will be introduced, the better.

@gryznar gryznar added enhancement New feature or request mojo Issues that are related to mojo labels Oct 8, 2023
@ematejska ematejska added the mojo-lang Tag for all issues related to language. label Oct 9, 2023
@gryznar gryznar changed the title [Feature Request] Add compiler warnings for usage of inappropriate case [Feature Request] Add compiler warnings (or errors) for usage of inappropriate case Feb 21, 2024
@ematejska ematejska added the mojo-repo Tag all issues with this label label Apr 29, 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 mojo Issues that are related to mojo mojo-lang Tag for all issues related to language. mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

2 participants