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

lint rule for visibility annotations #932

Closed
jessegreenberg opened this issue Apr 9, 2020 · 24 comments
Closed

lint rule for visibility annotations #932

jessegreenberg opened this issue Apr 9, 2020 · 24 comments

Comments

@jessegreenberg
Copy link
Contributor

I made a lint rule to catch missing visibility annotations for method declarations. Would people find this useful generally or annoying? We could probably also have a lint rule to catch missing visibility annotations on instance variables.

@jessegreenberg
Copy link
Contributor Author

Checked in but not enabled. When run with lint-everything, it is catching 752 methods that do not have visibility annotations.

@samreid
Copy link
Member

samreid commented Apr 16, 2020

Looks great, we should enable this and address existing deficiencies.

@zepumph
Copy link
Member

zepumph commented May 7, 2020

I think we should turn it on! Thanks for implementing it.

zepumph added a commit to phetsims/utterance-queue that referenced this issue May 7, 2020
zepumph added a commit to phetsims/gravity-force-lab-basics that referenced this issue May 7, 2020
zepumph added a commit to phetsims/gravity-force-lab that referenced this issue May 7, 2020
zepumph added a commit to phetsims/wilder that referenced this issue May 7, 2020
@zepumph
Copy link
Member

zepumph commented May 7, 2020

To turn it on, go to chipper/eslint/rules/.eslintrc.js and uncomment the visibility-annotation rule.

UPDATE FROM @samreid: Then run with --disable-eslint-cache

UPDATE FROM @pixelzoom:

  • The correct file to edit is chipper/eslint/.eslintrc.js
  • The command to run is grunt lint --disable-eslint-cache

Devs will take on their own sims, and we may make a chip-away list.

@pixelzoom pixelzoom self-assigned this May 7, 2020
@samreid
Copy link
Member

samreid commented May 7, 2020

Currently at 812 errors for that lint rule (from lint-everything).

UPDATE: This looks like some other lint errors crept in, may not be accurate.

@pixelzoom
Copy link
Contributor

Self assigning to run this lint rule on the sims that I'm responsible for.

samreid added a commit to phetsims/bending-light that referenced this issue May 7, 2020
pixelzoom added a commit to phetsims/reactants-products-and-leftovers that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/balancing-chemical-equations that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/function-builder-basics that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/acid-base-solutions that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/graphing-quadratics that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/equality-explorer that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/natural-selection that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/molecule-polarity that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/function-builder that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/vector-addition that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/graphing-lines that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/gas-properties that referenced this issue May 8, 2020
pixelzoom added a commit to phetsims/beers-law-lab that referenced this issue May 8, 2020
@jbphet
Copy link
Contributor

jbphet commented Jun 8, 2020

I've addressed this in the sim and common repos for which I believe I'm responsible. I'm not sure why, but I'm the only one who was assigned to this issue. I'm going to pass it off to @jessegreenberg because there seem to be a number of a11y-related instances of this problem in inverse-square-law-common and tappi. Other than that, there are just a handful that we can probably tackle in the meeting when we turn on the lint rule.

@jessegreenberg - you're welcome to assign to whoever owns the most instance of these errors once you're done.

@pixelzoom
Copy link
Contributor

pixelzoom commented Jun 8, 2020

@jbphet you were the only person assigned because you were the last to have items to check off in the checklist found in #932 (comment). Can all of those now be checked off?

@jbphet
Copy link
Contributor

jbphet commented Jun 8, 2020

@pixelzoom - Thanks for pointing that out - I've checked off the items that I addressed. There are still 24 errors occurring for grunt lint-everything.

pixelzoom added a commit to phetsims/axon that referenced this issue Jun 8, 2020
pixelzoom added a commit to phetsims/tandem that referenced this issue Jun 8, 2020
pixelzoom added a commit to phetsims/axon that referenced this issue Jun 8, 2020
@pixelzoom
Copy link
Contributor

pixelzoom commented Jun 8, 2020

I took care of a few of the remaining errors, which all appear to be new problems that have crept in.

Here's what's left:

pixelzoom added a commit to phetsims/tappi that referenced this issue Jun 8, 2020
pixelzoom added a commit to phetsims/scenery that referenced this issue Jun 8, 2020
pixelzoom added a commit to phetsims/ratio-and-proportion that referenced this issue Jun 8, 2020
pixelzoom added a commit to phetsims/inverse-square-law-common that referenced this issue Jun 8, 2020
@pixelzoom
Copy link
Contributor

I addressed the new errors noted in #932 (comment), then enabled the visibility-annotations rule, so that we don't introduce more errors.

I posted this PSA to the Slack developer channel:

24 new cases of missing visibility annotations have snuck in. So I addressed all of them, and then enabled the visibility-annotation lint rule. Please pull chipper so that you have this new rule, otherwise you run the risk of introducing a new lint error that will fail in CT. More details at #932.

@pixelzoom
Copy link
Contributor

pixelzoom commented Jun 8, 2020

@jessegreenberg review the changes that I made to his code. @zepumph will review if he wants to. Consensus on Slack was to close this issue.

jessegreenberg added a commit to phetsims/greenhouse-effect that referenced this issue Apr 21, 2021
jessegreenberg added a commit to phetsims/greenhouse-effect that referenced this issue Apr 21, 2021
samreid added a commit to phetsims/scenery-phet that referenced this issue Oct 29, 2022
samreid added a commit to phetsims/scenery-phet that referenced this issue Oct 29, 2022
zepumph pushed a commit to phetsims/perennial that referenced this issue Oct 22, 2024
zepumph pushed a commit to phetsims/perennial that referenced this issue Oct 22, 2024
zepumph pushed a commit to phetsims/perennial that referenced this issue Oct 22, 2024
zepumph pushed a commit to phetsims/perennial that referenced this issue Oct 22, 2024
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