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

Run python linter in CI #5238

Merged
merged 1 commit into from Jan 30, 2023
Merged

Run python linter in CI #5238

merged 1 commit into from Jan 30, 2023

Conversation

akuzm
Copy link
Member

@akuzm akuzm commented Jan 27, 2023

Helps find some errors and cosmetic problems.

Specifically, I added prospector because it combines many different linters and has lenient defaults. We could also run black on them but that might be too opinionated.

Disable-check: force-changelog-changed

@github-actions
Copy link

@pmwkaa, @mkindahl: please review this pull request.

Powered by pull-review

@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #5238 (7d6280f) into main (3348641) will increase coverage by 26.00%.
The diff coverage is n/a.

❗ Current head 7d6280f differs from pull request most recent head 4422da4. Consider uploading reports for the commit 4422da4 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #5238       +/-   ##
===========================================
+ Coverage   63.03%   89.04%   +26.00%     
===========================================
  Files         225      225               
  Lines       45706    51853     +6147     
===========================================
+ Hits        28812    46171    +17359     
+ Misses      16894     5682    -11212     
Impacted Files Coverage Δ
tsl/test/src/remote/scan_exec_debug.c 71.42% <0.00%> (-11.91%) ⬇️
tsl/test/src/test_chunk_stats.c 92.59% <0.00%> (-7.41%) ⬇️
src/uuid.c 78.57% <0.00%> (-6.05%) ⬇️
src/histogram.c 83.83% <0.00%> (-4.80%) ⬇️
tsl/src/fdw/fdw_utils.c 80.76% <0.00%> (-4.65%) ⬇️
src/time_utils.c 93.72% <0.00%> (-3.78%) ⬇️
src/time_bucket.c 95.81% <0.00%> (-2.76%) ⬇️
src/hypertable_cache.c 93.25% <0.00%> (-2.64%) ⬇️
tsl/src/dist_backup.c 92.30% <0.00%> (-2.52%) ⬇️
src/extension_utils.c 90.74% <0.00%> (-2.45%) ⬇️
... and 201 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3348641...4422da4. Read the comment docs.

@fabriziomello
Copy link
Contributor

Same as mentioned in another PR: #5237 (comment)

on:
"on":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not how it is done in other YAML files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's for the next PR: #5237
Apparently on is a truthy value, and somehow this applies to keys as well, so it's better to quote it. Same as the famous Norway problem :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion on doing one way or the other, as long as it is consistent, simple to use, and clear to readers. However, since most of the examples on GitHub does not quote this, people will keep writing the unquoted version, and it will just generate extra work for no specific reason. Is it possible to tweak this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can disable this particular warning globally. Not sure how useful it is. We don't often add new workflows though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't often add new workflows though.

Good point. We can also disable it later if it turns out to be a nuisance and cause friction. I have approved the PR, so you can decide what you think is best.

Comment on lines -45 to +50
self.has_subject_body_separator = (len(lines[1].strip()) == 0)
self.has_subject_body_separator = len(lines[1].strip()) == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange rule to complain about the first approach since it is a lot easier to read. But if that is what it says...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember modifying it, probably that's the black formatter... On the good side, it is not configurable, so we can just give up and live with its minor weirdnesses :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. If this is what either of the tools say out of the box, we just roll with it. Just wasn't sure if that was the case.

Helps find some errors and cosmetic problems.
@akuzm akuzm enabled auto-merge (rebase) January 30, 2023 09:18
@akuzm akuzm merged commit 21a3f82 into main Jan 30, 2023
@akuzm akuzm deleted the aku/python-linter branch January 30, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants