SketchUp / rubocop-sketchup

Rubocop cops for SketchUp - test against our Extension Warehouse technical requirements and other pitfalls
MIT License
14 stars 8 forks source link

rubocop-sketchup for libraries #134

Open Eneroth3 opened 4 years ago

Eneroth3 commented 4 years ago

I'm more and more writing libraries meant to be used in SketchUp extensions, in addition to just writing SketchUp extensions themselves. I've been thinking of what cops are relevant to both an extension and a library, and which only applies to extensions.

From what I can see SketchupBugs, SketchupDeprecations, SketchupPerformance and SketchupSuggestions apply equally to extensions and libraries meant for extensions, while SketchupRequirements also contain extension specific things like FileStructure.

Perhaps SketchupRequirements could be split into a general SketchupRequirements and a more specific SketchupExtensionRequirements?

Maybe this is a rare use case and not worth taking into account in rubocop-sketchup, I would totally respect that. It's still possible to just disable cops as you go if you get an offense that doesn't apply to libraries, but official support could on the other hand encourage more people to publish reusable code as libraries.

thomthom commented 4 years ago

I think this would be easier to define if we could get something like skippy to form some uniform library handling.

How about you record your findings in this thread? Note what doesn't apply to a library vs extension. Then we can look for patterns.

Eneroth3 commented 4 years ago

Sounds like a good idea!