-
Notifications
You must be signed in to change notification settings - Fork 452
Add lint and coverage report on ci builds #65
base: main
Are you sure you want to change the base?
Conversation
To be honest, I don't like this too much. While I agree that it would be good to have lint messages and code coverage information, I don't think that having them printed buried in the logs of our continuous integration is ideal. In another project I am maintaining we're using "GitHub apps" like Codacy and Codecov that add comments/checks to the GitHub pull request page. (This means that lint messages appear on the line they are about, and that a decreasing coverage causes a warning or error). I'm not exceedingly happy with those two specific tools (Codacy has quite few false positives and negatives, Codecov seems to be a bit noisy). I'd love to hear suggestions for better alternatives. In any case, I like their "approach" more than what is introduced by this pull request... What do you think? PS: I'm also a bit wary of adding code coverage information because I expect our score there to be awful... |
I don't see any drawback on having them logged. The tools you mentioned can be seen as a visual aid to what's inside the build log, but that's just my point of view. Instead I believe that is important for the project to have a script inside
If we want to use codecov, the changes introduced are necessary anyway. |
Well, I see two "drawbacks" in having the lint done as part of our CI: it slows the CI down (delaying the time-to-signal) and it adds noise (e.g., the CI for this PR is failing because of lint warnings, style issues, no real error). I wouldn't mind this if it gave a useful report but, as I said, the fact that it is hidden in the logs makes it hard to find and use. I would first explore external apps like Codacy (not necessarily that one, I'm just naming it because it's the only one I know). If they don't suit our needs then, well, we'll have to roll our own solution and it will be the easiest to have it be part of our CI. And you're right that even if we use Codecov we'll have to collect coverage data during our CI runs. I do agree that it's good to have a simple way to run all tests, both by end users and inside the CI. I searched for that and found a setuptools solution that I implemented in #66. A plus of it is that it doesn't require pytest or other additional dependencies. In conclusion, let me think about it for a bit and I'll get back to you. |
I personally don't consider this hard to find and use. You click on details and it tells you exactly where and what the problem is. Indeed it's quite common for open source projects to have this kind of setup.
Great, I like it! |
Unlike |
I was talking of flake8 in particular because is written in here: CONTRIBUTING, and I thought it was the one adopted by the project. |
Oops, I forgot about that. Maybe I copied it from another project when setting up this repo? I guess at this point we can stick to it... What do you think of the |
I expect a proper dev setup to take care of installing dev dependencies for me. (I think extras_require can be used for this) Eg: [options.extras_require]
testing =
flake8
[flake8]
max-line-length = #some number
exclude =
__pycache__,
.git,
.circleci,
.github,
docs,
torch_extensions,
docs |
Types of changes
Motivation and Context / Related issue
The code needs to linted during ci builds.
Please note that the build now fails due to some lint errors.
Please share your preferred flake8 configs, if you have any.
How Has This Been Tested (if it applies)
Checklist