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

-e parameter now handle regular espression #164

Closed
wants to merge 7 commits into from

Conversation

wallaroo
Copy link
Contributor

if only one -e parameter is passed to cli and the value matches /.*/[gmiuy]{0,5} then this is treated as a Regular Expression

@alexyork
Copy link

Today I discovered I need this feature, also. Can someone on the react-docgen team merge this into master and ship a new version?

My usecase is this: I want to point to a /components folder and create docs for my components but exclude all files that match the pattern *.example.js. Currently -e *.example.js sends in ['*.example.js'] as a string, not a RegEx, so I cannot achieve what I want via the CLI.

I tried this PR and passed in -e /.example.js/ and it worked as expected.

I would love it if this got merged in :-)

@fkling
Copy link
Member

fkling commented May 26, 2017

I will look at it over the weekend!

@@ -68,6 +68,11 @@ var ignoreDir = argv.ignore;
var excludePatterns = argv.exclude;
var resolver;
var errorMessage;
var regexRegex = /\/(.*)\/([igymu]{0,5})/;
Copy link
Member

Choose a reason for hiding this comment

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

The pattern should be anchored:

/^\/(.*)\/([igymu]{0,5})$/;

Otherwise it looks fine to me!

@fkling
Copy link
Member

fkling commented Jun 14, 2017

Merged as d9782c8 . Will release a new version soon.

@fkling fkling closed this Jun 14, 2017
@fkling
Copy link
Member

fkling commented Jun 14, 2017

Released v2.16.0! v3 beta will follow.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants