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

Codespell #994

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

luszczewskakasia1
Copy link

Description

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • CI workflows, not executed per PR (e.g. Nightly), execute properly
  • New tests added, especially if they will fail without my changes
  • Added/extended example(s) to cover this functionality
  • Extended the README/documentation
  • All newly added source files have a license
  • All newly added source files are referenced in CMake files
  • Logger (with debug/info/... messages) is used

@luszczewskakasia1 luszczewskakasia1 requested a review from a team as a code owner December 12, 2024 12:51
@luszczewskakasia1 luszczewskakasia1 mentioned this pull request Dec 12, 2024
10 tasks
set -ex

SCAN_RESULT=`codespell -H --quiet-level=3 --skip="*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp,./.venv" --ignore-words-list="ASSER,Tne,ba,BA"`
echo -e "${SCAN_RESULT}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need this extra var SCAN_RESULT - codespell should just print its output to stdout, right?

@@ -57,6 +57,9 @@ jobs:
with:
config: ./.github/workflows/.spellcheck-conf.toml

- name: Run codespell
run: |
bash .github/scripts/codespell.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for bash part, its already done thanks to shebang in your script (#!/bin/bash)

@@ -57,6 +57,9 @@ jobs:
with:
config: ./.github/workflows/.spellcheck-conf.toml

- name: Run codespell
run: |
Copy link
Contributor

Choose a reason for hiding this comment

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

you can drop | if it's a one line command call and fit it all in line with run:


set -ex

SCAN_RESULT=`codespell -H --quiet-level=3 --skip="*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp,./.venv" --ignore-words-list="ASSER,Tne,ba,BA"`
Copy link
Contributor

Choose a reason for hiding this comment

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

why --quiet-level=3? I guess it can be verbose


set -ex

SCAN_RESULT=`codespell -H --quiet-level=3 --skip="*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp,./.venv" --ignore-words-list="ASSER,Tne,ba,BA"`
Copy link
Contributor

Choose a reason for hiding this comment

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

is there like a lot issues in these files? why skipping so much?

for sure we want to skip *.supp,./.venv, the others, I'm not sure

you can shorten the list of skipped files and not fix any issues. The CI will fail then and we could observe the output of this script and make the decision what to do with issues (if any)

@@ -0,0 +1,6 @@
#!/bin/bash

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -0,0 +1,6 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

you can rename the script file, to have a meaningful name, e.g. run-codespell.sh


set -ex

SCAN_RESULT=`codespell -H --quiet-level=3 --skip="*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp,./.venv" --ignore-words-list="ASSER,Tne,ba,BA"`
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is just one line to trigger, I don't see why it has to be a separate script instead of having the command directly in the workflow run command.
If it were to be used by developers apart from CI, it should be a python script so it could be run both on Windows and Linux.

Copy link
Contributor

Choose a reason for hiding this comment

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

We decided with @lplewa that the script is good, can be re-used.

As for Windows, is it supported? if so, perhaps we should write that script in python...


set -ex

SCAN_RESULT=`codespell -H --quiet-level=3 --skip="*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp,./.venv" --ignore-words-list="ASSER,Tne,ba,BA"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there plenty of false-positives in source code files, like i.e. .h, .c, .cpp? This spell checker would be very useful in these files, too.

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.

3 participants