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

Add globIgnore arg #26

Closed
wants to merge 1 commit into from
Closed

Add globIgnore arg #26

wants to merge 1 commit into from

Conversation

filipesilva
Copy link
Contributor

Following discussion on #25, I worked on adding an exclude functionality, and also wanted to always use node-glob for all patterns.

When I was thinking about how to parse the args, I figured that a whitelist would be needed so that I could separate between what args to let through to the clang-format binary and which should I try to glob.

I also tried to figure a good way to support multiple globs together with multiple ignore patterns, and it began sounding more difficult than I initially thought.

So I ended up only adding the --globIgnore= argument. I thought it would be simpler and more obvious. If a user wants native clang-format behaviour he will use everything but the double dash args.

This left out version. I refactored it so that -version is passed to the native binary, but --version is used by the wrapper. This way the wrapper only has to process double dash args throughout.

I also had to slightly refactor the tests to run on windows though, the path in EXPECTED_VERSION_STRING wasn't playing well with windows paths, but now it should work.

This might be too much for a single PR but these changes followed one another so I left them.

@@ -31,9 +31,9 @@ function clangFormat(file, enc, style, done) {
function spawnClangFormat(args, done, stdio) {
// WARNING: This function's interface should stay stable across versions for the cross-version
// loading below to work.
if (args.indexOf('-version') !== -1 || args.indexOf('--version') !== -1) {
if (args.indexOf('--version') !== -1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This used to support -version and --version, please don't break that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed intercepting of -version so that it could be passed onto the native binary (enabling getting it's version), and so that all intercepted commands would be the double-dash ones.

It's not very obvious at all without reading the readme though, and it is a breaking change. This is confined to the last commit so it should be easy to remove from the PR. Do you want me to do so?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mprobst can you still answer this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think --version and -version should behave identically, and both give the version of the NPM package, i.e. should be intercepted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Roger, will modify to do that. I'll also squash everything into a single commit.

@mprobst mprobst assigned alexeagle and unassigned mprobst Mar 21, 2016
@mprobst
Copy link
Contributor

mprobst commented Mar 21, 2016

@alexeagle, maybe this is something for you, as you reviewed the original PR?

@mprobst
Copy link
Contributor

mprobst commented Oct 16, 2017

Closing this out, I don't think we'll get to this.

@mprobst mprobst closed this Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants