django-cms icon indicating copy to clipboard operation
django-cms copied to clipboard

ci: Add codespell to pre-commit and setup.cfg

Open cclauss opened this issue 2 years ago • 6 comments

Description

Add codespell to pre-commit and setup.cfg and fix typos along the way.

Related resources

  • #...
  • #...

Checklist

  • [x] I have opened this pull request against develop
  • [x] I have added or modified the tests when changing logic
  • [ ] I have followed the conventional commits guidelines to add meaningful information into the changelog
  • [ ] I have read the contribution guidelines and I have joined #workgroup-pr-review on Slack to find a “pr review buddy” who is going to review my pull request.

cclauss avatar Apr 01 '22 05:04 cclauss

This pull request introduces 2 alerts when merging 3fc73965fd56a7408012f0e49b077f6a6b35e40c into 1849fa0f4dfe6cb79ce8c886fc87d978001e7507 - view on LGTM.com

new alerts:

  • 2 for Too few arguments in formatting call

lgtm-com[bot] avatar Apr 11 '22 23:04 lgtm-com[bot]

Perhaps the JavaScript should go in .js files that are read by the Python code.

cclauss avatar Apr 12 '22 00:04 cclauss

@cclauss yes I couldn't agree more. I was thinking the same thing when I was looking at this again last night.

Or even html files that contain the current string with placeholders for the necessary context variables. The widget can then render the template to a string so that it's still returning the same thing.

marksweb avatar Apr 12 '22 07:04 marksweb

OK. I have reverted all changes to cms/forms/widgets.py and requested (in setup.cfg) that codespell ignore that file for now. See #7300 for the typo fix. We can attack removal of JavaScript code from cms/forms/widgets.py in a separate PR.

html files that contain the current string with placeholders for the necessary context variables

I am unclear how to implement this so a short example would help.

cclauss avatar Apr 12 '22 08:04 cclauss

Ok just tested this out with another PR and I'd extend the skip config to include common directories that we don't care about;

skip = *.js,*.po,./node_modules/*,./docs/env/*,./docs/build/*,./.env/*,./.venv/*,./build/*,./django_cms.egg-info/*

marksweb avatar May 24 '22 13:05 marksweb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 30 '22 17:08 stale[bot]

This will now be closed due to inactivity, but feel free to reopen it.

stale[bot] avatar Sep 27 '22 18:09 stale[bot]