Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(awslint): modules inside aws-cdk-lib are not linted anymore #26839

Closed
jogold opened this issue Aug 22, 2023 · 1 comment · Fixed by #27160
Closed

(awslint): modules inside aws-cdk-lib are not linted anymore #26839

jogold opened this issue Aug 22, 2023 · 1 comment · Fixed by #27160
Assignees
Labels
aws-cdk-lib Related to the aws-cdk-lib package bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@jogold
Copy link
Contributor

jogold commented Aug 22, 2023

Describe the bug

Modules inside aws-cdk-lib are not awslinted anymore. Only core is linted.

Expected Behavior

All code should be linted.

Current Behavior

Modules exported with as are not linted (e.g. export * as aws_s3 from './aws-s3')

Reproduction Steps

Remove the docstring of a public API element and run yarn build, it should fail but passes.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.92.0

Framework Version

No response

Node.js Version

All

OS

All

Language

Typescript

Language Version

No response

Other information

No response

@jogold jogold added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 22, 2023
@github-actions github-actions bot added the aws-cdk-lib Related to the aws-cdk-lib package label Aug 22, 2023
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Aug 22, 2023
github-merge-queue bot pushed a commit to cdklabs/awscdk-service-spec that referenced this issue Sep 20, 2023
Add `docTags` field to the DocSpec interface.

This is a dependency of aws/aws-cdk#26839.

---------

Co-authored-by: Mike Wrighton <mikewr@amazon.com>
@mergify mergify bot closed this as completed in #27160 Sep 22, 2023
mergify bot pushed a commit that referenced this issue Sep 22, 2023
Various fixes to awslint. Also adds new exclusions to prevent existing lint errors from failing the build - will address these errors in a follow-up. Linter config, including exclusions, has been moved into a new file `awslint.json`. If this file does not exist, the linter will continue reading and updating the config in `package.json`. Fixes #26839.

Linter changes:
- Include symbols from submodules by using e.g. `assembly.allClasses` instead of `assembly.classes`
- Fix FQNs in the construct linter by including the submodule name
- Use `cloudformationResource` tag (added in cdklabs/awscdk-service-spec#538) to store CFN resource ID when generating L1 constructs. This is used in the CFN resource linter.
- Fix `core-types.ts` to use new package names
- Ignore version suffixes when guessing resource names in `packages/awslint/lib/rules/resource.ts`

The change in `aws-apigateway/lib/resource.ts` is an example of a `props-physical-name` fix.

Breakdown of new linter errors:
```
docs-public-apis: 2308
props-default-doc: 214
props-physical-name: 106
attribute-tag: 13
construct-interface-extends-iconstruct: 8
resource-interface-extends-resource: 8
from-method: 8
props-no-cfn-types: 7
ref-via-interface: 5
from-signature: 4
construct-ctor-props-optional: 3
props-no-arn-refs: 3
props-no-any: 2
integ-return-type: 2
module-name: 1
construct-ctor: 1
props-struct-name: 1
construct-ctor-props-type: 1
no-static-import: 1
public-static-props-all-caps: 1
Total: 2697
```

### Tasks
- [x] Push cdklabs/awscdk-service-spec#538 before merging

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
aws-cdk-lib Related to the aws-cdk-lib package bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants