-
Notifications
You must be signed in to change notification settings - Fork 178
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
Conversation
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! |
Hi! |
I have updated the commit. @Nosferatul |
The commit message looks good to me 👍 |
@@ -123,14 +121,10 @@ brackets. Parentheses that have no match are ignored as well as | |||
False |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. :)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @fneu
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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. :)
ba18a77
to
24103fb
Compare
Please review now. @Adrianzatreanu |
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. |
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 |
How did you define "necessary"?
|
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; |
IMO if every example has a meaning as documentation we should have some text explaining them |
CC @fneu |
Yes, we should explain some examples so that the user would understand faster. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Can you explain a little ? @Nosferatul @sils |
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unusual space before comma
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
did the changes. @AbdealiJK @adtac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -174,14 +209,10 @@ brackets. Parentheses that have no match are ignored as well as | |||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.' '
There was a problem hiding this comment.
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 `` .
There was a problem hiding this comment.
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 *.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
ack fd9e6d7 |
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
reack 2d070c6 |
@rultor merge |
It removes some unnecessary examples.
Closes #70