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

Precommit hooks print duplicate error message. #1359

Closed
pixelzoom opened this issue Nov 23, 2022 · 6 comments
Closed

Precommit hooks print duplicate error message. #1359

pixelzoom opened this issue Nov 23, 2022 · 6 comments

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Nov 23, 2022

Reported in #1350 (comment) 12 days ago. It's partially fixed but still some problems.

Slack#developer:

@pixelzoom:
I noticed that there were some changes to git hooks today. When I encounter errors, I’m now seeing duplicate errors in WebStorm console, for example see below. Is it possible that something is being run twice?

0 errors in 16559ms
/Users/cmalley/PhET/GitHub/natural-selection/js/common/view/NaturalSelectionTimeControlNode.ts
14:8 error 'merge' is defined but never used @typescript-eslint/no-unused-vars
17:8 error 'AssertUtils' is defined but never used @typescript-eslint/no-unused-vars
21:8 error 'Tandem' is defined but never used @typescript-eslint/no-unused-vars
✖ 3 problems (3 errors, 0 warnings)
Task failed: lint,
/Users/cmalley/PhET/GitHub/natural-selection/js/common/view/NaturalSelectionTimeControlNode.ts
14:8 error 'merge' is defined but never used @typescript-eslint/no-unused-vars
17:8 error 'AssertUtils' is defined but never used @typescript-eslint/no-unused-vars
21:8 error 'Tandem' is defined but never used @typescript-eslint/no-unused-vars
✖ 3 problems (3 errors, 0 warnings)

@zepumph:
Most likely it's just duplicate logging. "lint" is in a child process now, so there are probably two spots where we report logging from the subtask. I'd just note it in #1350

@kathy-phet
Copy link

@pixelzoom - It looks like @samreid posted a commit to address this issue, but maybe it is not working for you?

@samreid
Only output error messages once, see #1350
d6255e4

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Nov 23, 2022

I'm no longer seeing duplicate lint errors. But I'm still seeing duplicate tsc error messages. For example, 1 error, 2 duplicate messages:

/Users/cmalley/PhET/GitHub/gas-properties/js/common/model/BaseContainer.ts(99,5): error TS2322: Type 'number' is not assignable to type 'Bounds2'.
1 error in 11513ms
{
  code: 1,
  stdout: "/Users/cmalley/PhET/GitHub/gas-properties/js/common/model/BaseContainer.ts(99,5): error TS2322: Type 'number' is not assignable to type 'Bounds2'.\n" +
    '1 error in 11513ms\n',
  stderr: '',
  cwd: '../chipper',
  time: 11579
}
17:26:31.288: [gas-properties] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- js/common/model/IdealGasLawContainer.ts

Compare to what I see when running tsc directly: 1 error, 1 message.

% cd gas-properties
% node ../chipper/node_modules/typescript/bin/tsc
js/common/model/BaseContainer.ts:99:5 - error TS2322: Type 'number' is not assignable to type 'Bounds2'.

99     this.maxBounds = 1;
       ~~~~~~~~~~~~~~


Found 1 error in js/common/model/BaseContainer.ts:99

@kathy-phet
Copy link

OK - I fixed the summary above saying partially fixed. @samreid and @zepumph can take another look next week, after the holiday.

@samreid
Copy link
Member

samreid commented Nov 23, 2022

I saw this as well--it seems tsc has a self-printing phase, so the prior fix only fixed other tasks. I'll take a look at tsc now.

@samreid
Copy link
Member

samreid commented Nov 23, 2022

OK I pushed a fix and it seems better in my testing, @pixelzoom can you please verify? Please close if all is well.

@pixelzoom
Copy link
Contributor Author

Fix tested, much nicer output. For the example above, I now see:

/Users/cmalley/PhET/GitHub/gas-properties/js/common/model/BaseContainer.ts(99,5): error TS2322: Type 'number' is not assignable to type 'Bounds2'.
1 error in 12833ms

Thanks. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants