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.

tests: Start linting tests

See original GitHub issue

I believe we should enable linting (tox -e lint) for new test files (maybe even for some recent additions). Possibly some exceptions are needed but in general I think the tests would be better if they were linted.

Good start for this would be test_updater_with_simulator.py and repository_simulator.py: it’s new code and files are small so the changes are easy – the real job is figuring out how to select what to lint… Possible options:

  • separate directory for legacy (unlinted) tests?
  • define list of linted files in tox.ini / setup.cfg ? (I don’t like this one as it means default for new files is no lint)
  • define list of files excluded from lint in tox.ini & setup.cfg ?
  • some other strategy?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
joshuaglcommented, Sep 15, 2021

Splitting tests across multiple directories may make sense, but I think the right combination of simple and not prone to error is a list of files excluded from lint? That way, new test files are linted and there’s no ambiguity about where to place new tests.

Also, the no-lint list gets shorter as we replace/remove existing tests.

0reactions
MVrachevcommented, Jan 7, 2022

TODO items left to close this issue:

  • address pylint and mypy warnings | #1657
  • add configuration to actually start linting the tests
Read more comments on GitHub >

github_iconTop Results From Across the Web

How Unit Testing, Linting, and Continuous Integration in ...
Lint would go through your program and look for errors, bugs, stylistic issues, etc. This idea is that our “linter” would pick up...
Read more >
Lint Check Unit Testing - Google Samples
Everything is kept together, so it's easier to look at a test and see what it analyzes and what the expected results are....
Read more >
Unit Tests - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Automated Code Linting and Testing | by Harsh Verma - Medium
1)Setup husky · 2)Install lint-staged · 3)Now lets setup “Prettier” to format our code · 4)Adding Jest as well · 5)Adding “.editorconfig” file....
Read more >
How to Test Custom Lint Checks - Infinum
Lint checks are tested with the JUnit framework. The only part that's a bit different is that your class must extend LintDetectorTest class ......
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