Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Coding standard automated checks for Python projects #35

Closed
giorgiosironi opened this issue Aug 16, 2018 · 12 comments
Closed

Coding standard automated checks for Python projects #35

giorgiosironi opened this issue Aug 16, 2018 · 12 comments
Assignees

Comments

@giorgiosironi
Copy link
Member

giorgiosironi commented Aug 16, 2018

Coding standards common problems:

  • mixture of formatting patterns (single and double quotes)
  • enforcement of type hints
  • unused variables, leftover unused imports

Standard tools for enforcing used at elife:

We may use some of these tools directly and find a way to extract a common configuration later.
/cc @thewilkybarkid for common proofreader-python problems

@de-code
Copy link

de-code commented Aug 16, 2018

Just to be sure, we don't want to use proofreader-python for now?

@giorgiosironi
Copy link
Member Author

It may be too eLife-specific and/or force too many pinned versions of dependencies. I'd welcome an experiment.

@thewilkybarkid
Copy link
Contributor

IIRC there are pinned dependency problems. Would rather static tools weren't part of the app too (to avoid other dependency incompatibilities). But it's somewhere to start.

@de-code
Copy link

de-code commented Aug 20, 2018

Also worth adding a markdown linter. The one used in VSCode is https://github.com/DavidAnson/markdownlint but requires an extra dependency. Perhaps use a separate docker image for that.

@de-code
Copy link

de-code commented Aug 20, 2018

First PR to introduce pylint: libero/content-store#9

@de-code
Copy link

de-code commented Aug 20, 2018

I wasn't planning on adding autopep8 as part of the pipeline. It's probably more useful for developers to make 'legacy' code compliant. Unless there are strong opinions.

@de-code
Copy link

de-code commented Aug 21, 2018

Actually wondering whether we should split the ticket instead, I can create one for pylint (currently in checking), flake8.

Optionally:

  • pyflakes (do we need it if we use pylint?)
  • markdown linting

@de-code
Copy link

de-code commented Aug 22, 2018

The scope of the ticket isn't well defined, can we now define it as please:

It mention Python projects. I believe at the time of creation it was just the content-store (and it is has the corresponding title). I think we should have separate tickets for each project (e.g. now validator?). So this ticket is just about the content-store.

@giorgiosironi
Copy link
Member Author

I'd stop with content-store and extract knowledge and tools from there after the setup is stable.

The current tools cover both style (flake8) and semantics (pylint) so I wouldn't add anything else at the moment unless you have something in the pipeline to try.

@de-code
Copy link

de-code commented Aug 22, 2018

No, there was nothing else I was going to add.

Apart from markdownlint (if you consider markdown as code).

@giorgiosironi
Copy link
Member Author

markdownlint approved and merged, it's useful to get feedback on minimal documentation changes. Let's consider it experimental if we have doubts about its stability.

@giorgiosironi
Copy link
Member Author

Can probably be closed now?

@de-code de-code closed this as completed Aug 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants