-
Notifications
You must be signed in to change notification settings - Fork 246
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
feat(jsii): switch to disable reserved words warnings #1076
Conversation
By default, jsii issues a warning when it encounters a symbol that uses a word that is reserved in one of the supported languages. Practically this creates a tremendous amount of noise for large existing projects. #1073 proposes to add support for a warning exclusion file, which is probably a better long term solution, but in the meantime, this switch allows opting-out of reserved words warnings in order to save the planet. Tested by adding `--disable-reserved-words-warnings` to `jsii-calc` (which uses many reserved words already).
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
When would such a warning actually create an issue, and how would we know? |
@nija-at wrote:
Since we have thousands of these warnings right now in the CDK (and jsii), it teaches developers to ignore warnings. We should always operate in "treat warnings as errors" mode. |
Clarifying the intention behind my question - If there are hundreds and there are no problems, is this a legit warning? |
@nija-at - the warning is here to prevent adding more identifies that will be awkward to non-TS users. We can usually work around those issues in code generation, but this will often be at the expense of ergonomics... For example, if you call something |
Thanks @RomainMuller - makes sense. This sounds like bad customer experience we should prevent for new APIs and API parameters. We should add the feature to exclude existing 'warnings' and change their behaviour to be an error (that fails the build). I would even say that this is time critical, to raise our bar on customer experience. Silencing these warnings for all CDK(v1) is only going to delay this work and allow more of these to-be-avoided identifiers to slip through, isn't it? |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this so much more than the previous iteration. Only one minor comment on there, and we're good to go!
Co-Authored-By: Romain Marcadier-Muller <[email protected]>
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
By default, jsii issues a warning when it encounters a symbol that uses a word that is reserved in one of the supported languages. Practically this creates a tremendous amount of noise for large existing projects.
#1073 proposes to add support for a warning exclusion file, which is probably a better long term solution, but in the meantime, this switch allows opting-out of reserved words warnings in order to save the planet.
Tested by adding
--disable-reserved-words-warnings
tojsii-calc
(which uses many reserved words already).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.