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

Private constant names generate warnings #223

Closed
Malcolmnixon opened this issue Aug 3, 2023 · 4 comments
Closed

Private constant names generate warnings #223

Malcolmnixon opened this issue Aug 3, 2023 · 4 comments
Labels
bug Something isn't working linter

Comments

@Malcolmnixon
Copy link

GDScript supports both public and private comments - with the private ones being omitted from generated GDScript documentation.

## Publicly visible constant shows up in generated documentation
const GRAVITY = 9.8

# Private constant is hidden
const _FLAGS_BUSY = 0x40

The default gdlint regular expression [A-Z][A-Z0-9]*(_[A-Z0-9]+)* does not permit leading underscores and so errors are reported:
Error: Constant name "_FLAGS_BUSY" is not valid (constant-name)

It seems like a similar single leading underscore should be permitted - _?[A-Z][A-Z0-9]*(_[A-Z0-9]+)* just as is permitted for numerous other names (functions, class-variables, etc.)

@Scony
Copy link
Owner

Scony commented Aug 3, 2023

I think I did it on purpose to mimic pylint behavior, but I'll check once again if there's any PEP8 for that.

@Scony
Copy link
Owner

Scony commented Aug 6, 2023

Looks like PEP8 has no strict guidelines, so let's follow Godot way - what's the Godot version you're using?

@Scony Scony added bug Something isn't working linter labels Aug 6, 2023
@Malcolmnixon
Copy link
Author

We're currently targeting 4.0.3 compatibility. Thanks!

@Scony
Copy link
Owner

Scony commented Aug 7, 2023

Ok, I'll add it to master then

@Scony Scony closed this as completed in c9ecf76 Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linter
Projects
None yet
Development

No branches or pull requests

2 participants