question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code Quality: Additional lints in this repository (help wanted!)

See original GitHub issue

We’re doing a bunch of code quality cleanup, and as part of that effort I’d like to implement some additional lints/coding conventions. There will be a lot of manual changes here, so I think these will be some items to have multiple people tackle.

In no particular order:

  • ~Add ban-relative-imports = true to .flake8 and remove relative imports from the repo.~
  • ~Add flake8-type-checking==1.0.4 to .pre-commit-config.yaml with enable-extensions = TC, TC2 in .flake8, and rework our type annotations for zero runtime cost using string constants. When we drop Python 3.6 support, pyupgrade will be used to automatically switch to from __future__ import annotations and unquote the annotations.~
  • ~Add flake8-use-fstring==1.3 to .pre-commit-config.yaml and fix all the use of .format() on string constants in the repo. Start at level 0, and try level 1 if possible. Level 2 is likely useless in this repo (I think we will always use .format() on string variables), but you could prove me wrong.~
  • ~Remove E501 from .flake8 – currently, black leaves our long comments, docstrings, and string constants alone – let’s hand-format them to comply with the line length limit.~

Please call dibs in this issue to prevent duplicated effort.

(suggestions for additional code quality improvements/tools to enforce them are also welcomed here)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:27 (25 by maintainers)

github_iconTop GitHub Comments

2reactions
finswimmercommented, Jan 16, 2022

I learned about nitpick these days. I wonder if we like to use it, to enforce a minimum set of checks across our repos?

1reaction
dimblebycommented, Jul 4, 2022

I find quite a lot to like in flake8-pie.

Not sure I agree with absolutely everything it warns about, but you can always disable the things that you don’t want.

(I don’t plan to work on adding this to the repository, if anyone wants to have a go then we will not be duplicating one another.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Quality - GitLab Docs
To ensure your project's code stays simple, readable, and easy to contribute to, you can use GitLab CI/CD to analyze your source code...
Read more >
Super-Linter · Actions · GitHub Marketplace
ENV VAR Default Value Notes DEFAULT_BRANCH master The name of the repository default branch. EDITORCONFIG_FILE_NAME.ecrc Filename for editorconfig‑checker configuration JSCPD_CONFIG_FILE.jscpd.json Filename for JSCPD configuration
Read more >
Commit Message Lint — Improve the Code Commit Quality
It enables you to perform linting checks, static code analysis, ... Central installation into the repository, providing more control.
Read more >
How to Use GitHub Super Linter in Your Projects
Linting is essentially a form of static code analysis. It analyzes the code you wrote against some rules for stylistic or programmatic errors....
Read more >
Automatically format and lint code with pre-commit - Interrupt
How to use pre-commit for automated linting, formatting, and styling firmware code by using Python, clang-format, clang-tidy, and prettier.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found