-
Notifications
You must be signed in to change notification settings - Fork 486
Add support for inferring private based on the name #441
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
Conversation
I wanted to add an end to end test since this does not test that the command line flag gets passed along all the way [*] but I wasn't sure how to best do that. Any suggestions? [*] it does from manual testing |
Great! The test/bin tests are where we do end-to-end testing. They don't have the same automatic fixture generation as test/test, but you could run assertions off of the output. |
I added a test to test/bin.js. This is ready for review. |
On a code level, it looks good to me, but I can't see how one would turn off inference entirely; you can replace the regex with a different one, but in order to "never infer private methods", I am inferring that you would have to write a regular expression that does not match anything, and for me that's a hard thing to guess at. |
That is a good point. Two alternatives.
I'm leaning towards 1. |
The option is now off by default. Let me know if you want me to squash the commits? |
👍 Excellent, yep, squash and I'll merge! |
1113330
to
98723e9
Compare
This adds a command line flag called `--infer-private` which is a string (defaults to `^_`) which is used as a regexp for inferring if a name is private or not. For example: ```js /** C */ class C { /** I'm public */ m() {} /** I'm private */ _p() {} } ``` Fixes documentationjs#436
Squashed and some minor cleanup |
👍 thanks, merging! |
* Improved whats's next? section
This adds a command line flag called
--infer-private
which is astring (defaults to
^_
) which is used as a regexp for inferringif a name is private or not.
For example:
Fixes #436