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

ci: continuing linting when one kind errors #4416

Merged
merged 15 commits into from
Feb 1, 2022
Merged

Conversation

turadg
Copy link
Member

@turadg turadg commented Jan 28, 2022

Description

It's helpful to developers that when CI fails you are informed what you need to do to make it pass. Presently when one kind of lint check fails, the logic fails fast and you get no information about subsequent ones. This was due to the steps in Github workflow and the && in the yarn lint scripts.

This makes the yarn lint command check all the defined lint:foo commands and continue when any error. It accomplishes this using https://github.com/mysticatea/npm-run-all .

It also:

  • update CI to use the one yarn lint so its steps don't fail fast
  • remove lint-check command since that's what lint does (checks)
  • removes tsc from lint-fix since it can't do any fixing.
  • remove the commands that used .eslintrc-jessie.js because that files doesn't exist (superceded by plugin:@jessie.js/recommended)

Security Considerations

Introduction of a new package. It's only a devDependency and is maintained by a well-regarded project lead who's a member of ESLint, Babel, and Vue.js.

Documentation Considerations

Notify developers to that yarn lint-check no longer works and to use yarn lint instead.

Testing Considerations

Locally tested that the different jobs run and failure of any is conveyed for the lint overall.

CI passes.

@dckc
Copy link
Member

dckc commented Jan 28, 2022

The current lint check in CI ... conflates type checking with linting

conflates? or usefully combines? they're both incomplete static checks on code, yes?

I suggest surveying more of the team, but to my mind, it's a feature, not a bug, that yarn lint does both.

If you want separate lint:eslint and lint:types ci jobs, very well. But I'm not convinced there's a good reason to change what yarn lint means.

@mhofman
Copy link
Member

mhofman commented Jan 28, 2022

I'm not sure about this. I'm actually more of the opinion of use "lint" as an umbrella not restricted to "eslint", but also for types and even an explicit "prettier" check, so I actually prefer the conflation.

As to the && making these sequential, it sure would be nice to have all output available when multiple errors exist, but is it really necessary?

@turadg
Copy link
Member Author

turadg commented Jan 28, 2022

conflates? or usefully combines? they're both incomplete static checks on code, yes?

Well taken. I was thinking of "lint" as "eslint" but that's just one type of lint.

As to the && making these sequential, it sure would be nice to have all output available when multiple errors exist, but is it really necessary?

I think it's a good requirement that when CI fails you are informed what you need to do to make it pass. Presently when one kind of lint check fails, you get no information about ones later in the && expression.

So that means:

conflates type checking with linting
the && expression means if any typechecks fail, linting isn't run

Instead I'll solve the latter so that the new CI check isn't necessary. (Saves setup time too.)

@turadg turadg marked this pull request as draft January 28, 2022 21:44
README.md Outdated
`node_modules/@agoric/marshal` is a symlink to `packages/marshal`).
`node_modules/@endo/marshal` is a symlink to `packages/marshal`).
Copy link
Member

@dckc dckc Feb 1, 2022

Choose a reason for hiding this comment

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

I doubt the symlink thing applies across monorepos. So maybe change the example from ERTP->marshal to Zoe->ERTP.

Copy link
Member Author

Choose a reason for hiding this comment

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

Dunno how that change got in the PR. Gone now.

@turadg turadg changed the title ci: move type checking from lint-check to new types-check ci: continuing linting when one kind errors Feb 1, 2022
@turadg turadg marked this pull request as ready for review February 1, 2022 20:11
@turadg turadg requested a review from dckc February 1, 2022 20:12
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

I'm a little hesitant to speak for the team on this... especially without an issue. But I guess I'm OK to give this my usual level of approval, which is: if it turns out to be broken, I agree to be responsible to fix it.

@turadg turadg added the automerge:squash Automatically squash merge label Feb 1, 2022
@@ -81,10 +82,10 @@
"link-cli": "yarn run create-agoric-cli",
"create-agoric-cli": "node ./scripts/create-agoric-cli.cjs",
"format": "yarn prettier --write 'packages/**/*.{js,jsx,ts,tsx}' 'golang/**/*.{js,jsx,ts,tsx}'",
Copy link
Member

@mhofman mhofman Feb 1, 2022

Choose a reason for hiding this comment

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

Should we rename to lint-fix:format in the principle of consistency? And introduce a lint-fix that performs the above and a workspace lint-fix (for the eslint fix)

Copy link
Member Author

Choose a reason for hiding this comment

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

I've been burned by eslint --fix enough not to trust it so I'd personally shy away from using a catch-all yarn lint-fix but I wouldn't object to a PR making that change.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed! But I believe it's used by some. I personally relies on my editor for formatting auto fixes, so I use neither. I'll let others chime in.

Comment on lines -14 to -15
"lint-fix-jessie": "eslint -c '.eslintrc-jessie.js' --fix '**/*.js'",
"lint-check-jessie": "eslint -c '.eslintrc-jessie.js' '**/*.js'",
Copy link
Member

Choose a reason for hiding this comment

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

Where did these go?

Copy link
Member Author

@turadg turadg Feb 1, 2022

Choose a reason for hiding this comment

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

I'll mention in the notes: there is no .eslintrc-jessie.js so these weren't even working. We have "plugin:@jessie.js/recommended" in eslint-config so it's handled by that.

Copy link
Member

Choose a reason for hiding this comment

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

Ping @michaelfig I assume?

Copy link
Member

Choose a reason for hiding this comment

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

yes, plugin:@jessie.js/recommended along with @jessie-check is the current mechanism.

@turadg turadg added automerge:squash Automatically squash merge and removed automerge:squash Automatically squash merge labels Feb 1, 2022
@mergify mergify bot merged commit f0eba3c into master Feb 1, 2022
@mergify mergify bot deleted the ta/separate-typecheck branch February 1, 2022 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:squash Automatically squash merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants