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

Setup linter / formatter for python #258

Closed
3 tasks
Enzyme3 opened this issue May 20, 2022 · 1 comment · Fixed by #259
Closed
3 tasks

Setup linter / formatter for python #258

Enzyme3 opened this issue May 20, 2022 · 1 comment · Fixed by #259
Assignees
Labels
feature: Architecture Pertains to project architecture and settings PBV: dev all issues for engineering roles (devops, backend, frontend, db) role: backend Pertains to backend tasks role: devops Pertains to cd/ci tasks size: 2pt Can be done in 7-12 hours

Comments

@Enzyme3
Copy link
Contributor

Enzyme3 commented May 20, 2022

Overview

We need to ensure that all backend developers who are contributing to the project are committing code that is stylistically consistent and follows general best practices. The usage of linters and formatters will help enforce this consistency.

Action Items

  • Determine linters / formatters to be used
  • Determine how the linters / formatters will be triggered
  • Implement

Resources/Instructions

  • Super-Linter is already setup as a Github action, but its use has been disabled for python files. Based on my current understanding, I am not certain if we should solely rely on this because:
    • It can suggest fixes, but cannot automatically apply them, which makes it suitable for linting, but not really for formatting
    • Cannot natively install python dependencies, which results in lots of import errors for django modules. Technically, there appears to be a workaround but sounds kludgey and brittle
    • bad developer UX. Instead of listing all of the lint errors, the errors are displayed on a per-file basis, i.e. with lots of boilerplate text in between each file. Have to do lots of scrolling to view the relevant messages
    • slow. even after container is up, much slower than one would expect for a linter
@Enzyme3 Enzyme3 added role: backend Pertains to backend tasks role: devops Pertains to cd/ci tasks labels May 20, 2022
@Enzyme3 Enzyme3 self-assigned this May 20, 2022
@Enzyme3
Copy link
Contributor Author

Enzyme3 commented May 20, 2022

Have investigated the use of pre-commit instead and made #259 to address
Uses the same libs that were commented out in super-linter: isort, pylint, flake8 and black

@Aveline-art Aveline-art added size: 2pt Can be done in 7-12 hours feature: Architecture Pertains to project architecture and settings ready for milestone labels May 20, 2022
@ExperimentsInHonesty ExperimentsInHonesty added the PBV: dev all issues for engineering roles (devops, backend, frontend, db) label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: Architecture Pertains to project architecture and settings PBV: dev all issues for engineering roles (devops, backend, frontend, db) role: backend Pertains to backend tasks role: devops Pertains to cd/ci tasks size: 2pt Can be done in 7-12 hours
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants