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

Let Flake8 check examples and fix warnings #1477

Merged
merged 11 commits into from
Sep 2, 2021
Merged

Let Flake8 check examples and fix warnings #1477

merged 11 commits into from
Sep 2, 2021

Conversation

maxrjones
Copy link
Member

Description of proposed changes

This PR enables flake8 checking of the examples directory and fixes resultant warnings.

The diff is very large because of the line length configuration (opinions welcome for whether this is worth the benefit of having style checks for the examples).

Fixes #948

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@maxrjones maxrjones self-assigned this Aug 31, 2021
@maxrjones maxrjones added documentation Improvements or additions to documentation maintenance Boring but important stuff for the core devs labels Aug 31, 2021
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

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

I'm OK with these changes.

Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

My eyes glossed over after scanning through diffs on 30-ish files... But ok with merging this big diff since you've done the hard work already. Thanks!

examples/gallery/symbols/datetime_inputs.py Outdated Show resolved Hide resolved
@weiji14 weiji14 added final review call This PR requires final review and approval from a second reviewer and removed documentation Improvements or additions to documentation labels Sep 1, 2021
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
@seisman seisman added this to the 0.5.0 milestone Sep 1, 2021
@maxrjones
Copy link
Member Author

Any ideas what's wrong with the windows tests?

@weiji14
Copy link
Member

weiji14 commented Sep 2, 2021

Any ideas what's wrong with the windows tests?

The Windows tests fail randomly sometimes. Maybe restart the tests (usually I would just ignore it, but since this is a big PR, best be safe).

@seisman
Copy link
Member

seisman commented Sep 2, 2021

FYI, I just restarted the tests.

@weiji14
Copy link
Member

weiji14 commented Sep 2, 2021

Thanks @seisman, all tests pass now! I'll merge this in.

@weiji14 weiji14 merged commit 16bc8ab into main Sep 2, 2021
@weiji14 weiji14 deleted the flake8-examples branch September 2, 2021 04:21
@weiji14 weiji14 removed the final review call This PR requires final review and approval from a second reviewer label Sep 2, 2021
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
This PR enables flake8 checking of the examples directory
and fixes resulting warnings.

* Update line lengths in gallery
* Update line lengths for tutorials
* Update whitespace and line length in projection gallery
* Update rose line length
* Fix invalid escape sequences
* Fix grdsample sphinx warning
* Update examples/gallery/symbols/datetime_inputs.py
* Format grdlandmask example

Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let flake8 check examples
3 participants