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

fix(scripts): skip clients while linting in CI #4129

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Nov 1, 2022

Issue

CI failure: sdk-staging-test:a618a080-3694-4f34-904c-fe6aefe4e1d7

...
/codebuild/output/src077611159/src/github.com/aws/aws-sdk-js-v3/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts
   51:3  error  'body' is never reassigned. Use 'const' instead  prefer-const
   82:3  error  'body' is never reassigned. Use 'const' instead  prefer-const
  108:3  error  'body' is never reassigned. Use 'const' instead  prefer-const

✖ 3 problems (3 errors, 0 warnings)
...

Description

Right now, we ignore ESLint error during client codegen as prefer-const rule fails.

// esprint throws error as the clients source code does not follow 'prefer-const' rule.
// And esprint does not have a way to override rules written in .eslintrc
// We will still get linted code though.

When we enabled lint:ci in our CI, it started because of prefer-const ESLint rule.
This PR skips clients in lint:ci, as they're already linted during codegen.

Testing

Verified that the command works in #4124

$ yarn lerna exec --since origin/main --exclude-dependents --ignore '@aws-sdk/client-*' --ignore '@aws-sdk/aws-*' 'eslint --quiet src/**/*.ts'

...
lerna notice cli v5.5.2
lerna notice filter excluding ["@aws-sdk/client-*","@aws-sdk/aws-*"]
lerna notice filter changed since "origin/main"
lerna notice filter excluding dependents
lerna info filter [ '!@aws-sdk/client-*', '!@aws-sdk/aws-*' ]
lerna info Looking for changed packages since origin/main
lerna info Executing command in 93 packages: "eslint --quiet src/**/*.ts"
lerna success exec Executed command in 93 packages: "eslint --quiet src/**/*.ts"
Done in 10.02s.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr requested a review from a team as a code owner November 1, 2022 02:47
@trivikr trivikr merged commit ffec8bd into aws:main Nov 1, 2022
@trivikr trivikr deleted the skip-clients-lint-ci branch November 1, 2022 05:54
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants