Skip to content

Let flake8 check examples #948

Closed

Description

@seisman

flake8 would check for whitespace and lines >80 (both not caught by black in examples); currently flake8 is only used for pygmt, setup.py, and doc/conf.py.

Originally posted by @meghanrjones in #935 (comment)

Do we want flake8 to check all examples? Or do we want to limit line length in examples?

Activity

  1. seisman commented on Feb 21, 2021

    @seisman
    MemberAuthor
  2. added
    question
    on Feb 21, 2021
  3. weiji14 commented on Feb 21, 2021

    @weiji14
    Member

    Funny, I was looking at flakehell too last week. Dropping flake8 and switching to flakehell might allow us to get rid of the setup.cfg file I think. See also https://dev.to/bowmanjd/using-flake8-and-pyproject-toml-with-flakehell-1cn1

  4. seisman commented on Feb 21, 2021

    @seisman
    MemberAuthor

    allow us to get rid of the setup.cfg file I think.

    Yes!

  5. added
    help wanted
    and removed
    question
    on Feb 21, 2021
  6. weiji14 commented on Feb 21, 2021

    @weiji14
    Member

    allow us to get rid of the setup.cfg file I think.

    Yes!

    See also https://stackoverflow.com/questions/44878600/is-setup-cfg-deprecated 😄. I think it should be safe to remove setup.cfg once (and if) we switch from flake8 to flakehell, but need to be extra careful in case it breaks some obscure Python packaging component.

  7. self-assigned this
    on Feb 23, 2021
  8. added this to the 0.3.1 milestone on Feb 23, 2021
  9. removed their assignment
    on Feb 23, 2021
  10. removed this from the 0.3.1 milestone on Feb 23, 2021
  11. seisman commented on Feb 23, 2021

    @seisman
    MemberAuthor

    Unfortunately, flakehell is no longer maintained.

  12. weiji14 commented on Feb 23, 2021

    @weiji14
    Member

    Unfortunately, flakehell is no longer maintained.

    Oo, that was sudden. Guess we'll need to find or wait for an alternative.

    Edit: Would autopep8 help with the original whitespace issue? It also support pyproject.toml according to https://github.com/hhatto/autopep8#pyprojecttoml

  13. seisman commented on Feb 25, 2021

    @seisman
    MemberAuthor

    As I understand it, flake8 is still the most popular and widely-used tool for style checking. I think we should still use flake8, and (1) wait for the official pyproject.toml support (https://gitlab.com/pycqa/flake8/-/issues/428); (2) see if someone forks and maintains flakehell; (3) see if there are similar wrappers.

    Back to the initial issue, I think we should let flake8 check the examples. It should also fix the trailing whitespace issue in #935.

    To let flake8 check all examples, we need to change one single line in Makefile:

    pygmt/Makefile

    Line 11 in e057927

    FLAKE8_FILES=$(PROJECT) setup.py doc/conf.py

    and fix all warnings.

    Before that, we need to discuss #962 first.

  14. added this to the 0.3.1 milestone on Feb 27, 2021
  15. added
    documentation
    on Feb 27, 2021
  16. modified the milestones: 0.3.1, 0.4.0 on Mar 9, 2021
  17. added
    maintenance
    on Mar 9, 2021
  18. seisman commented on Mar 19, 2021

    @seisman
    MemberAuthor
  19. modified the milestones: 0.4.0, 0.5.0 on Jun 1, 2021
  20. removed
    help wanted
    on Aug 31, 2021
  21. self-assigned this
    on Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationmaintenance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions