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

Enable require-jsdoc lint and add two lints related to React #6403

Merged
merged 22 commits into from
May 19, 2023

Conversation

somebody1234
Copy link
Contributor

Pull Request Description

  • Enables the require-jsdoc lint
  • Fixes all lint errors caused by enabling this lint.

Important Notes

  • There is no option to require JSDoc for other constructs, like top-level constants.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@somebody1234 somebody1234 added the CI: No changelog needed Do not require a changelog entry for this PR. label Apr 24, 2023
@somebody1234 somebody1234 changed the title Wip/sb/require jsdoc Enable require-jsdoc lint Apr 24, 2023
@somebody1234
Copy link
Contributor Author

oops :(

@somebody1234
Copy link
Contributor Author

umm

@somebody1234
Copy link
Contributor Author

not sure why prettier workflow failed, local run of prettier -w . doesn't change anything. it's says lib/dashboard/src/authentication/src/authentication/cognito.ts is formatted wrongly but i don't get any changes here

@PabloBuchu
Copy link
Contributor

@somebody1234 even this PR has some weird issues on first electron open after build. Would you mind taking a look?

Screenshot 2023-04-26 at 09 05 28

@somebody1234
Copy link
Contributor Author

@PabloBuchu hmm... unfortunately still can't repro :(
steps taken:

./run ide build --skip-version-check --skip-wasm-opt --wasm-profile=dev --backend-source release --backend-rele
ase nightly
~/dist/ide/enso-linux-2023.1.1-dev.AppImage -debug.dev-tools -authentication -feature-preview.new-dashboard

the first time i wasn't logged in though, rebuilt and still cannot repro. i can try a clean build?

Copy link
Member

@wdanilo wdanilo left a comment

Choose a reason for hiding this comment

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

Oh wow, I feel for you. Looks like a pretty tiring job with adding docs everywhere!

Comment on lines 117 to 119
/** Set Chrome options based on the app configuration. For comprehensive list of available
/** Sets Chrome options based on the app configuration. For comprehensive list of available
Copy link
Member

Choose a reason for hiding this comment

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

In all of our Rust codebase we have the opposite rule - instead of "Sets" we use "Set". I think we should be consistent here. Using docs in the imperative form rather than 3rd person form makes them shorter and unified with Rust codebase (which is unified with official Rust style guide).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah - i think the convention for TS in the other files was to use the opposite, but should be easy enough to change back

Comment on lines 133 to 135
const add = (option: string, value?: string) =>
/** Adds the specified Chrome option. */
function add(option: string, value?: string) {
chromeOptions.push(new configParser.ChromeOption(option, value))
}
Copy link
Member

Choose a reason for hiding this comment

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

why we need to change const lambdas int functions? This makes the code more verbose.

Comment on lines 71 to 76
// to generate a new target directory name;
// * contain the project files directly - in this case, the archive filename will be used
// to generate a new target directory name.
// We try to tell apart these two cases
// by looking at the common prefix of the paths of the files in the archive.
// If there is any, everything is under a single directory, and we need to strip it.
Copy link
Member

Choose a reason for hiding this comment

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

these docs are strangely formatted now. Some lines are too short.

FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true,
ArrowFunctionExpression: true,
Copy link
Member

Choose a reason for hiding this comment

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

I think that requiring docs on arrow fn exprs is an overkill. Vast majority of them are small helper functions that do not require better docs than just a good name. In case we will find a code during review with too long such an arrow expression, we can always refactor it to a normal fn :)

@@ -16,6 +16,7 @@ interface UserMenuItemProps {
onClick?: React.MouseEventHandler<HTMLDivElement>
}

/** User menu item */
Copy link
Member

Choose a reason for hiding this comment

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

missing dot

@wdanilo
Copy link
Member

wdanilo commented Apr 27, 2023

Ofc, please remember about Q/A before merging.

@somebody1234 somebody1234 changed the title Enable require-jsdoc lint Enable require-jsdoc lint and add two lints related to React Apr 27, 2023
@somebody1234
Copy link
Contributor Author

somebody1234 commented Apr 28, 2023

files with missing sections found using this fish shell command:

for f in (find . -not \( -name node_modules -prune \) \( -name '*.ts' -o -name '*.tsx' -o -name '*.js' \) ); grep "====" $f > /dev/null || echo $f; end

@somebody1234
Copy link
Contributor Author

/** and */ being on their own line should now be all removed.
the two exceptions are after @see which incorrectly triggers the jsdoc/no-multi-asterisks lint.

grep -Ir '/\*\*$\|^ \+\*/' --exclude-dir=node_modules

similarly with all lines over 100 characters long

grep -Ir '.\{101,\}' --exclude-dir=node_modules --include='*.ts' --include='*.js'

@wdanilo
Copy link
Member

wdanilo commented May 3, 2023

I was reviewing this a week ago - still no Q/A - who is handling Q/A here?

@somebody1234
Copy link
Contributor Author

@PabloBuchu @indiv0 could one of you perhaps do a QA?

@mwu-tow
Copy link
Contributor

mwu-tow commented May 8, 2023

@somebody1234
Please update this against the current develop. I've tried building this and running but I see some issues in the node editor that are not present on develop. I suppose they are not related to your changes, but still, I'd like to be able to QA this after merge conflicts are resolved.

@somebody1234
Copy link
Contributor Author

somebody1234 commented May 9, 2023

@mwu-tow merged, but i'm not sure any of the commits merged in would fix the issue you encountered - it was only missing the last 2 commits, so:

  • the TS lint revert
  • the "fix engine version check" commit

@mwu-tow
Copy link
Contributor

mwu-tow commented May 9, 2023

@somebody1234
Huh, to be honest, I have no idea why (it might have been just rebuilt) but after testing now all looks good!
🟢 and sorry for the confusion.

@PabloBuchu
Copy link
Contributor

@somebody1234 please merge with develop and solve conflicts so we can merge it :)

@PabloBuchu
Copy link
Contributor

@somebody1234 ping

@somebody1234
Copy link
Contributor Author

whoops, fixed @PabloBuchu. there are some minor changes, but they should all be changes to comments

@sylwiabr
Copy link
Member

@somebody1234 what is the status here?

@somebody1234
Copy link
Contributor Author

@sylwiabr should be ready, it's just had quite a few merge conflicts

@PabloBuchu
Copy link
Contributor

QA 🟢

@somebody1234
Copy link
Contributor Author

somebody1234 commented May 19, 2023

QA:
dashboard actions, tested using watch-dashboard.
✔️ rename project
✔️ delete project
✔️ create empty project
✔️ create project from template
✔️ delete project
✔️ create folder
✔️ create secret
✔️ delete secret
✔️ create file (upload via form) - note: errors when the file does not have an extension with "unable to upload file". it may be desirable to pass-through the error "file name must be in the format <file_name>." instead.
✔️ create file (button at top)
✔️ delete file
✔️ open help chat
✔️ filter using search bar
✔️ open user menu
✔️ change password (user menu) - onSubmit is fired twice; fixed in another PR.
✔️ sign out (user menu)
tested using ide build:
✔️ log in (email + password)
✔️ forgot password
✔️ reset password (incorrect code)
✔️ reset password (correct code)
✔️ switch backends
⚠️ oauth login works - i'm on linux so i'm unable to test. however, i got this warning while attempting to login anyway:

VM4 sandbox_bundle:2 MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open-deep-link listeners added

testing that frontend recompile watcher works:
✔️ ide watch
testing that live reload works:
✔️ gui watch - was navigating to / on reload, losing the query string; fixed in another PR
✔️ watch-dashboard

flags, tested using ide build:
✔️ -startup.entry=grid_view, dashboard enabled (should not appear on alternate entry points)
✔️ -startup.entry=grid_view
⚠️ -startup.project, dashboard enabled - this is being fixed in another PR.
✔️ -startup.project

@somebody1234 somebody1234 added the CI: Ready to merge This PR is eligible for automatic merge label May 19, 2023
@mergify mergify bot merged commit 658395e into develop May 19, 2023
@mergify mergify bot deleted the wip/sb/require-jsdoc branch May 19, 2023 19:55
Procrat added a commit that referenced this pull request May 22, 2023
…t-rename

* develop:
  Widgets, Vector as Column, Viz Fixes and Rename Columns (#6768)
  Implement simple variants of `parse` for the Database backend (#6731)
  Enable `require-jsdoc` lint and add two lints related to React (#6403)
  Decimal/Integer .round and .int #6654 (#6743)
  Set suggestion reexports when serializing the library (#6778)
  Fix file uploading node expression. (#6689)
  Using WarningsLibrary to query for warnings (#6751)
  Implement `cast` for Table and Column (#6711)
  Display Initializing project... message when initializing project (#6661)
  Only send suggestions updates when type changes (#6755)
  sbt runEngineDistribution --debug to ease debuggging (#6745)
  Display "modified at" column on the cloud dashboard (#6687)
  Meta.meta Integer . methods (#6740)
  Show spinner while loading directory (#6714)
  Add cloud dashboard to changelog (#6688)
  Fix list editor panics during insertion (#6540)
  Update bug-report.yml
  Remove project create form (#6710)
  Change full-screen visualisation shortcut to shift-space (#6663)
Procrat added a commit that referenced this pull request May 22, 2023
* develop: (30 commits)
  Widgets, Vector as Column, Viz Fixes and Rename Columns (#6768)
  Implement simple variants of `parse` for the Database backend (#6731)
  Enable `require-jsdoc` lint and add two lints related to React (#6403)
  Decimal/Integer .round and .int #6654 (#6743)
  Set suggestion reexports when serializing the library (#6778)
  Fix file uploading node expression. (#6689)
  Using WarningsLibrary to query for warnings (#6751)
  Implement `cast` for Table and Column (#6711)
  Display Initializing project... message when initializing project (#6661)
  Only send suggestions updates when type changes (#6755)
  sbt runEngineDistribution --debug to ease debuggging (#6745)
  Display "modified at" column on the cloud dashboard (#6687)
  Meta.meta Integer . methods (#6740)
  Show spinner while loading directory (#6714)
  Add cloud dashboard to changelog (#6688)
  Fix list editor panics during insertion (#6540)
  Update bug-report.yml
  Remove project create form (#6710)
  Change full-screen visualisation shortcut to shift-space (#6663)
  Revert "Show spinner when opening/creating a project (#6321)" (#6712)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants