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

Improved Camel Case linter to automatically detect if upper or lower … #1217

Merged
merged 5 commits into from
May 19, 2022

Conversation

rchache
Copy link
Contributor

@rchache rchache commented May 10, 2022

…camel should be enforced for consistency

Issue #, if available:
Users who consistently use upper camel for member shape member names will otherwise be flooded with extraneous violations that complain their names are not lower camel.

Description of changes:
With this change, we will add a new (default) mode to automatically detect whether the model uses upper or lower camel case more, and enforce that pattern.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchache rchache requested a review from a team as a code owner May 10, 2022 19:00
@mtdowling
Copy link
Member

I wonder of instead of needing to explicitly list namespaces to ignore (which is kind of breaking abstractions because this package shouldn't know about aws traits), we could instead validate services closures and potentially per/namespace?

So first we validate service closures by iterating over each service shape and use a Walker to find the closure of shapes connected to the service. We then do consistent casing on those.

Then, if we really wanted to and maybe we do this later, we could track shapes that weren't in any service closure and then validate per/namespace. That would catch things like inconsistencies across traits in a single namespace.

@JordonPhillips JordonPhillips merged commit e54bfd3 into smithy-lang:main May 19, 2022
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

Successfully merging this pull request may close these issues.

4 participants