Skip to content

Simplify formatting of matplotlibrc.template. #15023

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

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Aug 10, 2019

Having to specify formatting style conventions for matplotlibrc.template
is a bit overkill. Just use normal PEP8 style: no spaces before colons,
two spaces before inline comments, introduce comments with a single #.

Also remove the note re: "editor with python syntax highlighting", given
that the whole template appears as a long comment in Python so syntax
highlighting buys nothing.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer force-pushed the rcstyle branch 2 times, most recently from 3cfb0df to c1e4e2c Compare August 10, 2019 15:41
@tacaswell tacaswell added this to the v3.3.0 milestone Aug 11, 2019
Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

The wording at the top needs a bit of work, but overall 👍

Checked that this will still parse cleanly:

strippedline = line.split('#', 1)[0].strip()
if not strippedline:
continue
tup = strippedline.split(':', 1)
if len(tup) != 2:
error_details = _error_details_fmt % (line_no, line, fname)
_log.warning('Illegal %s', error_details)
continue
key, val = tup
key = key.strip()
val = val.strip()

## which case, four more whitespaces are preferred
## Formatting: Use PEP8-like style (as enforced in the rest of the codebase),
## except that all non-empty lines (whether including an rc entry or just
## comments must start with an additional #.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## comments must start with an additional #.
## comments must start with an additional #).

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 understand this sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reworded, does it sound better?

Having to specify formatting style conventions for matplotlibrc.template
is a bit overkill.  Just use normal PEP8 style: no spaces before colons,
two spaces before inline comments, introduce comments with a single #.

Also remove the note re: "editor with python syntax highlighting", given
that the whole template appears as a long comment in Python so syntax
highlighting buys nothing.
@timhoffm timhoffm merged commit e10e87c into matplotlib:master Feb 11, 2020
@anntzer anntzer deleted the rcstyle branch February 11, 2020 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants