cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

pre-commit: add `codespell` to check spelling

Open jbampton opened this issue 2 years ago • 7 comments

Description

This PR adds codespell to our pre-commit hooks.

The words in codespell.txt are ignored and this file has basically been created by running:

codespell . | cut -f2 -d' ' | tr A-Z a-z | sort | uniq > codespell.txt

from the repo root.

https://github.com/codespell-project/codespell

codespell is one of the leading spell checkers on GitHub.

Going forwards we will need to fix a lot of the misspelled words that are in codespell.txt

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)
  • [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
  • [X] 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 codespell --all-files

Or to run all the hooks:

pre-commit run --all-files

How did you try to break this feature and the system with this change?

jbampton avatar Nov 08 '23 12:11 jbampton

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 15.53%. Comparing base (9f1577d) to head (416707a). Report is 4 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8197      +/-   ##
============================================
- Coverage     15.53%   15.53%   -0.01%     
  Complexity    11966    11966              
============================================
  Files          5492     5492              
  Lines        480929   480929              
  Branches      60325    62046    +1721     
============================================
- Hits          74710    74708       -2     
- Misses       397957   397959       +2     
  Partials       8262     8262              
Flag Coverage Δ
uitests 4.17% <ø> (ø)
unittests 16.30% <ø> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 08 '23 12:11 codecov[bot]

looks good @jbampton . Should we consider the contents of codespell.txt as a list of nouns to review/improve?

DaanHoogland avatar Nov 08 '23 12:11 DaanHoogland

Hey @DaanHoogland yes we need to review codespell.txt. It does have lots of spelling mistakes.

We can also exclude files/folders from spell checking if needed.

jbampton avatar Nov 08 '23 13:11 jbampton

@jbampton , there is a bunch of PRs going on with "polish" in the name. I think this is a bit related to some of that work, And I think we should not exclude any folders. It might be worth to run this without the codespell.txt and analyse how much work it would be to clean it. I think in the end we do want to maintain a short list in that file. I.E. we do want "cloudstack" (not in the file) and "attache" to be allowed for instance. ;) NOTE: "attache" from french "attaché" is the name of type of a piece of code responsible for managing a resource. There is bound to be some more in there. Very interesting addition!

DaanHoogland avatar Nov 08 '23 13:11 DaanHoogland

@blueorangutan package

jbampton avatar May 12 '24 22:05 jbampton

@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.

blueorangutan avatar May 12 '24 22:05 blueorangutan

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

blueorangutan avatar May 13 '24 00:05 blueorangutan

@blueorangutan test

DaanHoogland avatar May 18 '24 20:05 DaanHoogland

@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

blueorangutan avatar May 18 '24 20:05 blueorangutan

[SF] Trillian Build Failed (tid-10215)

blueorangutan avatar May 18 '24 20:05 blueorangutan

@blueorangutan test

DaanHoogland avatar May 22 '24 08:05 DaanHoogland

@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

blueorangutan avatar May 22 '24 08:05 blueorangutan

[SF] Trillian test result (tid-10244) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 52031 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8197-t10244-kvm-centos7.zip Smoke tests completed. 129 look OK, 2 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 431.60 test_events_resource.py
test_02_trigger_shutdown Failure 351.72 test_safe_shutdown.py

blueorangutan avatar May 22 '24 23:05 blueorangutan

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar May 28 '24 07:05 github-actions[bot]

@blueorangutan package

jbampton avatar Jul 08 '24 02:07 jbampton

@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.

blueorangutan avatar Jul 08 '24 02:07 blueorangutan

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

blueorangutan avatar Jul 08 '24 04:07 blueorangutan

Hey @DaanHoogland the list of words in .github/linters/codespell.txt will need fixing in other PRs in future.

Basically codespell ignores those words when it runs the spell check.

So this PR is just adding the codespell test and making sure it passes.

You can see that on the last commit in this PR we are regressing and new misspelled words have been added.

https://github.com/apache/cloudstack/pull/8197/commits/7384e8220cda32f5674e9133527a3e514f802858

So until we get this PR merged misspelled words will continue to be added the codebase.

In future as we clean up and and fix spelling we will recreate the ignored word list hopefully with less misspelled words each time.

jbampton avatar Jul 08 '24 12:07 jbampton

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jul 10 '24 09:07 github-actions[bot]

If I understood correctly, the .github/linters/codespell.txt file has a list of misspelled words that were found within the project and that are going to be ignored by codespell, right? If so, should we have a plan for removing and fixing these, so that eventually the file is empty?

JoaoJandre avatar Jul 11 '24 13:07 JoaoJandre

Hey @JoaoJandre yes you are correct.

I have been working on spelling fixes for a while now and have a couple of PRs in progress with spell fixes.

jbampton avatar Jul 11 '24 14:07 jbampton