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

Add pre-commit, apply to all files #7641

Merged
merged 2 commits into from
Feb 17, 2020

Conversation

mshriver
Copy link
Member

Include python-reorder, flake, and local uuids-fix to start

Remove pylint config, makefile commands for flake/lint/pre-commit

Run pre-commit on all files in travis

gitignore venv/egg directories

Docs should be updated to reflect these changes, if I get agreement on making this switch I'll make those updates.

@mshriver mshriver added the enhancement An addition to the robottelo framework label Feb 13, 2020
Copy link
Contributor

@mirekdlugosz mirekdlugosz left a comment

Choose a reason for hiding this comment

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

  1. Can you make that two separate commits, one for real changes (.pre-commit-config.yaml, travis, makefile, docs etc.) and one for changes done automatically by reorder-python-imports command?

    This will help during review (you can set github to show changes from one commit and focus on what really matters), and in future when someone will need to go through history for any reason (as automatic changes are clearly separated and easy to ignore).

  2. travis failed for this PR in pre-commit run step.

Copy link
Contributor

@mirekdlugosz mirekdlugosz left a comment

Choose a reason for hiding this comment

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

Thanks for splitting commits, that makes it easier to review and read in future.

When I opened travis in the morning, it failed in unrelated robottelo unit test. This is intermittent failure that appears rarely (maybe 5% of PRs top), and usually it's enough to restart build. I did so, but #7625 got merged in the meantime and now causes travis to complain again.

ACK. Obviously we need to rebase before merge.

To anyone who will be merging this: please do not squash the commits :) .

@@ -348,7 +348,8 @@ you have `graphviz`_ installed::

To check for code smells::

$ make lint
$ pre-commit install-hooks
$ pre-commit run --all-files
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically changes in that file belong to commit 99b0508 , as they weren't done by pre-commit. But that's not a big deal, we can leave it as is.

@rochacbruno
Copy link
Contributor

rochacbruno commented Feb 14, 2020

As we are already touching almost every file in this PR why not applying black? so it will be just one PR to review.

@mshriver @JacobCallahan

This other PR #7458 also changes a lot of files, for sure will conflict with this one. I am in favour of doing this change also using pre-commit.

@mshriver
Copy link
Member Author

@rochacbruno absolutely we'll be using black via pre-commit, but I think that they are separate considerations for the team. One can go without the other, and vice versa.

It will take some rebasing, but I'd rather consider using pre-commit first, and then add more checks to pre-commit once we have the team using it.

My preference would be to consider them as separate PRs/changes, but I can certainly be convinced otherwise.

@JacobCallahan
Copy link
Member

@rochacbruno i'll revive the black PR once this is merged, as I can just add black to the pre-commit

Copy link
Member

@JacobCallahan JacobCallahan left a comment

Choose a reason for hiding this comment

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

ACK. I'll wait until monday to merge, in case anyone else wants to look at it and possibly raise suggestions.

…unctions

Update code_standards doc to reflect flake config

Use reorder_python_imports, which will split imports into single line direct imports, instead of allowing grouping.
@codecov
Copy link

codecov bot commented Feb 17, 2020

Codecov Report

Merging #7641 into master will increase coverage by 0.35%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7641      +/-   ##
==========================================
+ Coverage   67.57%   67.93%   +0.35%     
==========================================
  Files          30       30              
  Lines        3778     3814      +36     
==========================================
+ Hits         2553     2591      +38     
+ Misses       1225     1223       -2     
Impacted Files Coverage Δ
robottelo/decorators/func_locker.py 91.72% <0.00%> (+1.50%) ⬆️

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 e079ea2...5b00291. Read the comment docs.

@JacobCallahan JacobCallahan merged commit 564494c into SatelliteQE:master Feb 17, 2020
@vijay8451
Copy link
Member

@mshriver is same change going to adopt in 6.6.z/6.5.z/6.4.z branches  as well ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An addition to the robottelo framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants