openhab / openhab/static-code-analysis
TypeNameCheck
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 34
- Forks
- 24
- Avg merge
- 7h 49m
- Merged PRs (30d)
- 10
Description
Argh - this one is going to be painful for me. Looks like the type name check enforces a pattern '^[A-Z][a-zA-Z0-9]*$'.
Is there any chance we can get an underscore or dash included with that?
The reasoning - for sony products, their API differs depending on the API's version. Example: setPowerStatus v1.0 has a parameter of boolean and the getPowerStatus v1.0 returns a boolean. However, setPowerStatus v1.2 has a parameter of string and the getPowerStatus v1.2 returns a string.
To handle this in a reasonable manner - I have a "PowerStatus_1_0" class and a "PowerStatus_1_2" class.
That's one example out of about 50 classes named this way (I have one class that has 5 different variations depending on the version).
With out an underscore (or dash) - I'd have to renamed stuff to "PowerStatusOneZero" and "PowerStatusOneTwo" or something screwy like that. Using namespaces to differentiate will also be an even bigger issue (alot of overlap between versions so naming something like 'v1-5.xxx" would be hard to understand when the api would be spread over different namespaces).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TypeNameCheck implementation and any tests covering the current type-name pattern. Review how names are validated, then define tests for the requested underscore or dash variants and confirm that existing valid names remain accepted. Done means the reported versioned class names are handled by the check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100