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

build(awslint): include types from submodules during linting #27160

Merged
merged 23 commits into from
Sep 22, 2023

Conversation

mikewrighton
Copy link
Contributor

@mikewrighton mikewrighton commented Sep 15, 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 feat(typewriter): Add docTags map to DocsSpec interface. 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

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

@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Sep 15, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team September 15, 2023 13:06
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 15, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything else looks good to me!

packages/aws-cdk-lib/package.json Outdated Show resolved Hide resolved
@mikewrighton mikewrighton marked this pull request as ready for review September 18, 2023 15:00
@mikewrighton mikewrighton changed the title fix(awslint): include types from submodules during linting build(awslint): include types from submodules during linting Sep 18, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review September 18, 2023 17:18

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@rix0rrr rix0rrr added the pr/do-not-merge This PR should not be merged at this time. label Sep 20, 2023
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditional approval

packages/aws-cdk-lib/aws-apigateway/lib/resource.ts Outdated Show resolved Hide resolved
@mikewrighton mikewrighton removed the pr/do-not-merge This PR should not be merged at this time. label Sep 20, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 22, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: d80af5c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 5ae9099 into main Sep 22, 2023
14 checks passed
@mergify mergify bot deleted the mikewrighton-26839-2 branch September 22, 2023 16:49
@mergify
Copy link
Contributor

mergify bot commented Sep 22, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(awslint): modules inside aws-cdk-lib are not linted anymore
4 participants