Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Add a descriptor plugin that emulates MXR's descriptor column.#561

Merged
pelmers merged 13 commits intomozilla:masterfrom
pelmers:dsecrips
Jul 18, 2016
Merged

Add a descriptor plugin that emulates MXR's descriptor column.#561
pelmers merged 13 commits intomozilla:masterfrom
pelmers:dsecrips

Conversation

@pelmers
Copy link
Contributor

@pelmers pelmers commented Jun 9, 2016

Also add some framework for plugins to supply needles on folders and
adding headers to the browsing view.

Fixes bug 1157968.
Example
screen shot 2016-06-09 at 8 55 06 am

return match.group('description')

def generic_describe(self):
"""Look at the first 60 lines for a match for
Copy link
Contributor

Choose a reason for hiding this comment

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

Crazy-narrow wrapping

@erikrose
Copy link
Contributor

erikrose commented Jun 9, 2016

I'm very excited about this. I'll give it a proper review later.

def concat_plugin_headers(plugin_list):
"""Return a list of the concatenation of all browse_headers in the
FolderToIndexes of given plugin list.
"""
Copy link
Contributor

@erikrose erikrose Jun 24, 2016

Choose a reason for hiding this comment

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

For consistency with the rest of the code, there should be a skipped blank line before the closing """. That would be a great thing for the linter to enforce. :-)

@erikrose
Copy link
Contributor

That's all I've got!

@pelmers
Copy link
Contributor Author

pelmers commented Jun 24, 2016

Thanks for the reviewing!

@@ -119,9 +119,9 @@ def generic_describe(self):
try:
description_re = re.compile(r'(?:{}|{}|description)\
Copy link
Contributor

@erikrose erikrose Jul 8, 2016

Choose a reason for hiding this comment

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

I don't think you can just throw line breaks and other whitespace into the middle of regexes and have it ignored, unless you set the re.X flag. You can either do that here or else lay a bunch of complete string literals end to end.

desc_lower = desc.lower()
# Skip any comment that contains the license or a tab-width
# emacs/vim setting.
if not any((pattern in desc_lower for pattern in {'tab-width', 'license', 'vim:'})):
Copy link
Contributor

@erikrose erikrose Jul 18, 2016

Choose a reason for hiding this comment

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

There's an extra set of parens here. (A genexpr doesn't need its own set if it's the only arg to a func.) And there's no sense using a set (and the extra hashing and RAM) because we're just iterating over it.

@erikrose
Copy link
Contributor

I just want to see the revised regex before merging.

@pelmers
Copy link
Contributor Author

pelmers commented Jul 18, 2016

@erikrose
Copy link
Contributor

r+! Hooray for user-visible changes!

@pelmers pelmers merged commit 35fbef5 into mozilla:master Jul 18, 2016
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.

2 participants