You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "jbampton (via GitHub)" <gi...@apache.org> on 2023/11/09 08:48:41 UTC

[PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

jbampton opened a new pull request, #8205:
URL: https://github.com/apache/cloudstack/pull/8205

   https://github.com/pre-commit/pre-commit-hooks#trailing-whitespace
   
   ### Description
   
   This PR adds another hook or test to our pre-commit framework.
   
   This hook automatically trims trailing whitespace when run locally.
   
   Follow up PRs can target more file types if needed.
   
   Extra unneeded whitespace is extra data.  Save the planet :)
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [X] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   
   `pre-commit run --all-files`
   
   or
   
   `pre-commit run trailing-whitespace --all-files`
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#discussion_r1387776718


##########
test/scripts/deploy-and-run-regression.sh:
##########
@@ -18,7 +18,7 @@
 
 
 
- 
+

Review Comment:
   but maybe that is another pre-commit hook



##########
test/scripts/deploy-and-run-regression.sh:
##########
@@ -18,7 +18,7 @@
 
 
 
- 
+

Review Comment:
   we could even remove some lines here
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#discussion_r1537615737


##########
.pre-commit-config.yaml:
##########
@@ -56,7 +56,7 @@ repos:
       - id: mixed-line-ending
         exclude: \.(cs|xml)$
       - id: trailing-whitespace
-        files: \.(java|md|py|sh|vue|yaml|yml)$
+        files: \.(in|java|md|py|rb|sh|vue|yaml|yml)$

Review Comment:
   ruby files?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-2016438193

   Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9015


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "jbampton (via GitHub)" <gi...@apache.org>.
jbampton commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-1803548377

   Hey @DaanHoogland  when the hook runs on GitHub with actions it is just a check that will either pass or fail.
   
   But when pre-commit is setup locally and run this hook will also automatically trim trailing whitespace.  
   
   So yes it is a corrective edit.  So all these whitespace clean ups were done automatically by the hook. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-2071574649

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "jbampton (via GitHub)" <gi...@apache.org>.
jbampton commented on code in PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#discussion_r1387796090


##########
test/scripts/deploy-and-run-regression.sh:
##########
@@ -18,7 +18,7 @@
 
 
 
- 
+

Review Comment:
   There are a large number hooks seen here: https://pre-commit.com/hooks.html
   
   I can clean up more but I was trying to keep this pr focused on one type of issue. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "jbampton (via GitHub)" <gi...@apache.org>.
jbampton commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-2106378402

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "jbampton (via GitHub)" <gi...@apache.org>.
jbampton commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-2016418260

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-2106397148

   Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9599


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#discussion_r1537615737


##########
.pre-commit-config.yaml:
##########
@@ -56,7 +56,7 @@ repos:
       - id: mixed-line-ending
         exclude: \.(cs|xml)$
       - id: trailing-whitespace
-        files: \.(java|md|py|sh|vue|yaml|yml)$
+        files: \.(in|java|md|py|rb|sh|vue|yaml|yml)$

Review Comment:
   ruby files?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-2106378549

   @jbampton a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-1803452814

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/8205?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#8205](https://app.codecov.io/gh/apache/cloudstack/pull/8205?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (ee479be) into [main](https://app.codecov.io/gh/apache/cloudstack/commit/29a223bf9b75bf62099c227b95d75cae65a1cf62?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (29a223b) will **decrease** coverage by `10.13%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@              Coverage Diff              @@
   ##               main    #8205       +/-   ##
   =============================================
   - Coverage     29.12%   18.99%   -10.13%     
   + Complexity    30976    17284    -13692     
   =============================================
     Files          5186     4698      -488     
     Lines        365754   315914    -49840     
     Branches      53489    44650     -8839     
   =============================================
   - Hits         106518    60016    -46502     
   - Misses       244628   247240     +2612     
   + Partials      14608     8658     -5950     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/8205/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [simulator-marvin-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `18.99% <ø> (-6.07%)` | :arrow_down: |
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/8205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   [see 2148 files with indirect coverage changes](https://app.codecov.io/gh/apache/cloudstack/pull/8205/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in [Chrome](https://chrome.google.com/webstore/detail/codecov/gedikamndpbemklijjkncpnolildpbgo) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/codecov/) today!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-2016418826

   @jbampton a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] pre-commit: add hook to trim trailing whitespace [cloudstack]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #8205:
URL: https://github.com/apache/cloudstack/pull/8205#issuecomment-2069438074

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/8205?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 31.16%. Comparing base [(`cadbb56`)](https://app.codecov.io/gh/apache/cloudstack/commit/cadbb563afaa907a45e8931cb8a95e8ca5b8f034?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`9177024`)](https://app.codecov.io/gh/apache/cloudstack/pull/8205?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 88 commits behind head on main.
   
   > :exclamation: Current head 9177024 differs from pull request most recent head 8b3d91f. Consider uploading reports for the commit 8b3d91f to get more accurate results
   
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               main    #8205       +/-   ##
   =============================================
   + Coverage     15.13%   31.16%   +16.02%     
   - Complexity    13469    34041    +20572     
   =============================================
     Files          4863     5404      +541     
     Lines        326031   380305    +54274     
     Branches      45838    55506     +9668     
   =============================================
   + Hits          49349   118524    +69175     
   + Misses       270066   246077    -23989     
   - Partials       6616    15704     +9088     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/8205/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [simulator-marvin-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.93% <ø> (+9.80%)` | :arrow_up: |
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/8205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.34% <ø> (?)` | |
   | [unit-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8205/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `16.88% <ø> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/8205?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org