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

Glob_Patterns.rst: Remove redundant examples #187

Merged
merged 1 commit into from
Nov 14, 2016
Merged

Conversation

aptrishu
Copy link
Member

@aptrishu aptrishu commented Oct 13, 2016

It removes some unnecessary examples.

Closes #70

@gitmate-bot
Copy link

Thanks for your contribution!

Reviewing pull requests take really a lot of time and we're all volunteers. Please make sure you go through the following check list and complete them all before pinging someone for a review.

As you learn things over your Pull Request please help others on the chat and on PRs to get their stuff right as well!

@Nosferatul
Copy link
Member

Hi! Fixes -> Closes. We use Fixes for bugs! The commit looks good to me!

@aptrishu
Copy link
Member Author

I have updated the commit. @Nosferatul

@Nosferatul
Copy link
Member

The commit message looks good to me 👍

@@ -123,14 +121,10 @@ brackets. Parentheses that have no match are ignored as well as
False
Copy link
Member

Choose a reason for hiding this comment

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

We could delete this example too. I don't find the purpose of it. This is my opinion. Don't do it until someone else says that it's ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

It justifies the statement that [!seq] here seq cannot be empty . If the seq is empty than no matter what pattern are you matching it with, it'll always return false. unless the string and pattern are exactly same. i.e;
if I do
fnmatch("a[!]a","a[!]a")
It will return true. :)

Copy link
Member

Choose a reason for hiding this comment

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

Why isnt [!] an error, or a noisy warning?
It is confusing to list it here, without explanation that this is invalid syntax.

Copy link
Member

Choose a reason for hiding this comment

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

CC @fneu

Copy link
Member Author

@aptrishu aptrishu Nov 11, 2016

Choose a reason for hiding this comment

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

So, should I add an explanation for that in there ? @jayvdb

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not a kind of error, I think. and as far as its output is concerned it's explained in the docs.

Copy link
Member Author

@aptrishu aptrishu left a comment

Choose a reason for hiding this comment

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

I have deleted only that much examples which are unnecessary and rest examples should be there to justify every pattern.

@@ -123,14 +121,10 @@ brackets. Parentheses that have no match are ignored as well as
False
Copy link
Member Author

Choose a reason for hiding this comment

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

It justifies the statement that [!seq] here seq cannot be empty . If the seq is empty than no matter what pattern are you matching it with, it'll always return false. unless the string and pattern are exactly same. i.e;
if I do
fnmatch("a[!]a","a[!]a")
It will return true. :)

@aptrishu aptrishu force-pushed the issue4 branch 2 times, most recently from ba18a77 to 24103fb Compare October 16, 2016 11:24
@aptrishu aptrishu changed the title Glob_Patterns.rst: Modify the examples Glob_Patterns.rst: Remove redundant examples Oct 16, 2016
@aptrishu
Copy link
Member Author

Please review now. @Adrianzatreanu

@sils
Copy link
Member

sils commented Oct 18, 2016

CC @fneu can you take a look? This looks still like way too many examples to me. I'd remove them all and think from scratch which examples are actually useful and add them with explanations.

@aptrishu
Copy link
Member Author

Should I explain every example what it stands for ? I can do that because I have kept only those examples which are necessary. @Nosferatul @sils @Adrianzatreanu

@sils
Copy link
Member

sils commented Oct 25, 2016 via email

@aptrishu
Copy link
Member Author

Every example that is there is only because it has a concept associated with it which can't be understood unless we show them that example. Like for example

[!seq] here seq cannot be empty . If the seq is empty than no matter what pattern are you matching it with, it'll always return false. unless the string and pattern are exactly same. i.e;
if I do
fnmatch("a[!]a","a[!]a")
It will return true.
fnmatch("aa","a[!]a")
returns false;
So, here I could only show the second example for the meaning of [!seq] but they need to know that if the seq and pattern are exactly the same then it'll always return true.

@sils
Copy link
Member

sils commented Oct 25, 2016

IMO if every example has a meaning as documentation we should have some text explaining them

@sils
Copy link
Member

sils commented Oct 25, 2016

CC @fneu

@Nosferatul
Copy link
Member

Yes, we should explain some examples so that the user would understand faster.

Copy link
Member

@adtac adtac left a comment

Choose a reason for hiding this comment

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

LGTM to me except for the one comment. Patch it and I'll ack it 👍

@@ -180,8 +174,6 @@ brackets. Parentheses that have no match are ignored as well as
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'd say we can remove L177 too (fnmatch("abc", "a*c")) since that is anyway covered with abbc.

Copy link
Member Author

Choose a reason for hiding this comment

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

It shows * can also work as ? . and can match more than one characters as well. Removing it though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done @adtac . I removed that line.

@aptrishu
Copy link
Member Author

Can you explain a little ? @Nosferatul @sils

@aptrishu aptrishu closed this Nov 7, 2016
@aptrishu aptrishu reopened this Nov 7, 2016
@aptrishu
Copy link
Member Author

aptrishu commented Nov 7, 2016

Sorry, closed the pull request by mistake. I have reopened it.


.. note::

If you don't know the fuctions of a bear or how to perform the analysis

Choose a reason for hiding this comment

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

Functions - typo.


coala --files='src/*.c' --bears=SpaceConsistencyBear --save

Here, ``*.c`` matches all ``.c`` files in the specified directory.

Choose a reason for hiding this comment

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

Mention src instead of specified directory to be clearer


.. note::

While using ``files = **/*.c`` , since we have used ``\`` in the glob

Choose a reason for hiding this comment

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

Unusual space before comma

Choose a reason for hiding this comment

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

I don't understand this note. Where is backslash used? Why will directories below root be matched?

Copy link
Member

Choose a reason for hiding this comment

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

it should be / I think

Using Glob Patterns
-------------------

Suppose you want `SpaceConsistencyBear` to perform an analysis on a file
Copy link
Member

Choose a reason for hiding this comment

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

doubleticks?


.. note::

While using ``files = **/*.c`` , since we have used ``\`` in the glob
Copy link
Member

Choose a reason for hiding this comment

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

it should be / I think

.. note::

While using ``files = **/*.c`` , since we have used ``\`` in the glob
pattern so all ``.c`` files at least one subdirectory below the root
Copy link
Member

Choose a reason for hiding this comment

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

I don't think using a so is valid when you begin a phrase with since? Not sure, others can chip in.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we shouldn't. I searched at english.stackexachange.

@aptrishu
Copy link
Member Author

did the changes. @AbdealiJK @adtac

Copy link

@arjunsinghy96 arjunsinghy96 left a comment

Choose a reason for hiding this comment

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

@aptrishu @adtac redundant '' are also present throughout the page .. rest seems fine to me.

@@ -174,14 +209,10 @@ brackets. Parentheses that have no match are ignored as well as

Choose a reason for hiding this comment

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

@aptrishu remove the redundant '' before special characters.

Copy link
Member Author

Choose a reason for hiding this comment

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

Where did you find the redundant ''? to be exact ? @arjunsinghy96

Choose a reason for hiding this comment

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

line 219 it is \*\* whereas it should be ** (The subheading). And may other occurrences are there. As this is not related to the issue, it is up to you if you want to do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Every '*' is an special character should be preceded by '' , unless used inside the quotes.' '

Choose a reason for hiding this comment

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

grave accent ``` is different from Apostrophe '. We use grave accent to highlight text not apostrophe. And under grave accent `*` is not a special character. Therefore, no need of `` .

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the heading there displays pattern the same way it should be used. I don't think it's about highlighting thing. (it's fine `` highlights the content, and it has no trouble being used with ) but coming to usage of glob pattern, while using in command line we should provide \ before each *.

Copy link
Member Author

@aptrishu aptrishu Nov 11, 2016

Choose a reason for hiding this comment

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

But following the wildcards of os , we don't need to use \ before each * .
**\ should be fine.

Choose a reason for hiding this comment

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

\ is not required before * in command line i guess

@sils
Copy link
Member

sils commented Nov 14, 2016

ack fd9e6d7

@sils
Copy link
Member

sils commented Nov 14, 2016

time to get this merged @aptrishu can you rebase and ping so we merge it?

It removes some unnecessary examples and adds some examples showing the usage of glob patterns.

Closes coala#70
@sils
Copy link
Member

sils commented Nov 14, 2016

reack 2d070c6

@sils
Copy link
Member

sils commented Nov 14, 2016

@rultor merge

@rultor
Copy link

rultor commented Nov 14, 2016

@rultor merge

@sils OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 2d070c6 into coala:master Nov 14, 2016
@rultor
Copy link

rultor commented Nov 14, 2016

@rultor merge

@sils Done! FYI, the full log is here (took me 1min)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

10 participants