Skip to content

spell: turn on pre-commit auto spell checker #1184

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

Merged
merged 5 commits into from
Jul 25, 2025

Conversation

dmyger
Copy link
Collaborator

@dmyger dmyger commented Jul 8, 2025

Turning on automatic static code analyzer: check words misspell for code files.

Closes #TNTP-3105

Come with second part in #1185

  • Well-written commit messages (see documentation how to write a commit message)

@dmyger dmyger force-pushed the dmyger/tntp-3105_turn_on_spell_checker_for_code branch from 370cdba to c04ce9f Compare July 10, 2025 12:09
@dmyger dmyger changed the title spell: turn on precommit spell checker for Python spell: turn on pre-commit auto spell checker Jul 10, 2025
@dmyger dmyger requested a review from oleg-jukovec July 10, 2025 12:11
@dmyger dmyger marked this pull request as ready for review July 10, 2025 12:11
@dmyger dmyger mentioned this pull request Jul 10, 2025
@dmyger dmyger force-pushed the dmyger/tntp-3105_turn_on_spell_checker_for_code branch from 2b4a206 to 59e26ec Compare July 10, 2025 13:03
@dmyger dmyger added the full-ci Enables full ci tests label Jul 10, 2025
@dmyger dmyger force-pushed the dmyger/tntp-3105_turn_on_spell_checker_for_code branch 3 times, most recently from b4547b7 to 20a96d7 Compare July 16, 2025 10:27
@@ -44,7 +46,7 @@ def skip_no_helpers(request: pytest.FixtureRequest, completion: Completion) -> N


def pytest_configure(config):
config.addinivalue_line(
config.addinivalue_line( # cSpell:words addinivalue
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's possible I'd suggest to introduce separate project-words file for integration tests directory. All pytest identifiers that are currently in use could be listed there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My opinion is that lists of “bad” words are workaround, because they should not exist. The fact that now a list of words is made at the project level is because there are too many such words already found throughout the old code. Ideally, the names should immediately meet the requirements of the checker.

And such marks raise a “red” flag - that something needs to be done here with refactoring. The word list on other hand hides this problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well... I agree with statement that "mark is better than hide", but what is need to be done with "third-party" identifiers (pytest identifier in this particular case) considering that we are not able to change them?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What exactly identifier do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

addinivalue_line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the current code it used only once at test/integration/completion/conftest.py:49? So I don't see a problem add a single comment to ignore it spell-checker:ignore ...

Copy link
Contributor

@elhimov elhimov Jul 25, 2025

Choose a reason for hiding this comment

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

And according to you it raises a "red" flag and something needs to be done. But since it is third-party identifier we are not able to do "something" with it (except of stop using it, but that's not the option obviously). Considering this project-words file might hold only "bad" words that can't be fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Anyway it's just a subject to discuss. I've approved PR already.

@dmyger dmyger force-pushed the dmyger/tntp-3105_turn_on_spell_checker_for_code branch from 20a96d7 to 707afff Compare July 22, 2025 10:17
@dmyger dmyger force-pushed the dmyger/tntp-3105_turn_on_spell_checker_for_code branch from 707afff to 25a4d6e Compare July 23, 2025 17:03
@dmyger dmyger requested a review from elhimov July 23, 2025 17:32
@dmyger dmyger force-pushed the dmyger/tntp-3105_turn_on_spell_checker_for_code branch from 25a4d6e to 89506dd Compare July 23, 2025 17:35
@dmyger dmyger force-pushed the dmyger/tntp-3105_turn_on_spell_checker_for_code branch 2 times, most recently from da4751e to 0e01c6d Compare July 24, 2025 14:22
@dmyger dmyger requested a review from elhimov July 24, 2025 15:23
dmyger added 4 commits July 25, 2025 13:23
Part of #TNTP-3105
Due to formatting changes, it triggers the linter's errors.
FIXME: turn on the checking with the following PR.

Part of #TNTP-3105
@dmyger dmyger force-pushed the dmyger/tntp-3105_turn_on_spell_checker_for_code branch from 0e01c6d to 400e4db Compare July 25, 2025 11:15
@dmyger dmyger merged commit ea135b6 into master Jul 25, 2025
33 of 34 checks passed
@dmyger dmyger deleted the dmyger/tntp-3105_turn_on_spell_checker_for_code branch July 25, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-ci Enables full ci tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants