-
Notifications
You must be signed in to change notification settings - Fork 580
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
KeywordBear: Add optional regex_keyword param #311
Comments
Thanks for reporting this issue! Your aid is required, fellow coalaian. Help us triage and solving this issue! CC @sils1297, @AbdealiJK |
|
It should then probably be renamed to MatchBear, BlacklistBear, or something. |
maybe we could add another parameter, |
@rubdos are you still on it? |
Unassigned because of inactivity |
Check bears/general/KeywordBear.py . Add optional param to |
@Nosferatul @sils All we need to do is to add a setting called |
I think it would be nice by the way if we could plan the configuration
format in a way that would be extensible to also support substitutions
later.
…On Fri, Dec 30, 2016, 2:53 PM Abhijeet Dubey ***@***.***> wrote:
@Nosferatul <https://github.com/Nosferatul> @sils
<https://github.com/sils> All we need to do is to add a setting called
regex_keyword and check all words in a file which matches this regex...
So basically we need to modify the run function of KeywordBear...Am I on
the right track ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#311 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAuVN4lhoN-8LzSUwMCAYXIspRkJiJSks5rNQzUgaJpZM4H9ECE>
.
|
@underyx we can have |
The use case I had in mind was auto-replacing wrongly written stuff when
running with coala -a, and sharing information via the coafile across a
team about how things are written correctly.
…On Fri, Dec 30, 2016, 3:52 PM Abhijeet Dubey ***@***.***> wrote:
we can have regex_keyword for finding certain keywords and each time a
match happens we can prompt a user if he wants to change that word with
something else or not... how does this sound ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#311 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAuVBnBKA8t_QUp9pP0sV_fgFwUasvBks5rNRq2gaJpZM4H9ECE>
.
|
@underyx IMO the problem with using coala -a is even if we use regex to detect some wrongly written stuff, how will we know what should be the 'correct' phrase to replace the wrong phrase with ? Consider that we want to replace 'somthng' with 'something', then user can give regex to find 'somthng' but replacing it with 'something' without asking the user seems weird and can cause problems right ? |
It should be specified in the coafile. As an example you could replace
'anything = logging.getLogger()' with 'logger = logging.getLogger()' to
have standard naming.
…On Fri, Dec 30, 2016, 4:26 PM Abhijeet Dubey ***@***.***> wrote:
@underyx <https://github.com/underyx> IMO the problem with using coala -a
is even if we use regex to detect some wrongly written stuff, how will we
know what should be the 'correct' phrase to replace the wrong phrase with ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#311 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAuVF-Jhz6vxRGmcKkXhkSPR9dEP55zks5rNSKugaJpZM4H9ECE>
.
|
@underyx so finally what we would like to do is to find keywords using the regex specified in |
Oh, to be clear, the scope of this issue is still just the regex keyword
functionality. I'll have to open a new issue about the replace/patch
suggestion feature. I just wanted to mention it in case we could save time
later by planning for it now.
…On Fri, Dec 30, 2016, 6:15 PM Abhijeet Dubey ***@***.***> wrote:
@underyx <https://github.com/underyx> so finally what we would like to do
is to find keywords using the regex specified in regex_keyword and each
time a match occurs replace it with whatever is specified in coafile. So
basically there should be two settings specified in coafile regex_keyword
and replace_keyword.
Is that it or do you want to add something more to this ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#311 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAuVDQj71XrqLuY8T2ZIRMOt863eBTjks5rNTw1gaJpZM4H9ECE>
.
|
@underyx so what's the point of just matching some keywords and not doing anything ? |
I would like to work on this... however IMO there should be one more issue for the functionality that we discussed here... 😄 |
The point is to warn that 'anything = logging.getLogger()' is wrong. It's
easier to implement just this warning so let's just start with that.
…On Fri, Dec 30, 2016, 8:57 PM Abhijeet Dubey ***@***.***> wrote:
I would like to work on this... however IMO there should be one more issue
for the functionality that we discussed here... 😄
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#311 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAuVCu9MP5duXFqBruY73na3ePIPS95ks5rNWJCgaJpZM4H9ECE>
.
|
@underyx I have one more doubt... Do we still want to keep existing setting |
Ensures that keywords within a file can be matched against a user defined regex. A testcase is also added in KeywordBearTest.py for this feature. Closes coala#311
No description provided.
The text was updated successfully, but these errors were encountered: