Skip to content

Commit

Permalink
ci: incorporate codespell
Browse files Browse the repository at this point in the history
Use file-wide ignores for now until inline ignores are supported, see
codespell-project/codespell#3387.
  • Loading branch information
nijel committed Apr 25, 2024
1 parent 33cc633 commit d189b19
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ repos:
additional_dependencies:
- '@biomejs/[email protected]'
files: \.js$

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli

exclude: ^.*\.(csv|svg|wsdl(\.[^.]*)?)|weblate/trans/tests/data/memory-broken\.json|weblate/templates/browserconfig\.xml|weblate/templates/configuration/custom\.css|weblate/trans/tests/data/cs-CZ\.rc|weblate/static/vendor/.*|docs/make\.bat|weblate/templates/addons/js/weblate\.js$
ci:
Expand Down
2 changes: 1 addition & 1 deletion docs/admin/install/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ Other authentication settings

Minimal password score as evaluated by the `zxcvbn
<https://github.com/dropbox/zxcvbn>`_ password strength estimator.
Defaults to 3, set to 0 to disable strenght checking.
Defaults to 3, set to 0 to disable strength checking.


PostgreSQL database setup
Expand Down
6 changes: 3 additions & 3 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Not yet released.
* Allow editing strings when the source is marked for editing.
* Updates of last updated timestamp of a string.
* Fixed project and site wide installation of :ref:`addon-weblate.git.squash` and :ref:`addon-weblate.discovery.discovery` add-ons.
* Graceful handling of locking erors in the :ref:`api`.
* Graceful handling of locking errors in the :ref:`api`.

**Compatibility**

Expand Down Expand Up @@ -57,7 +57,7 @@ Released on April 20th 2024.

**Improvements**

* Docker container now validates user password strenght by default, see :envvar:`WEBLATE_MIN_PASSWORD_SCORE`.
* Docker container now validates user password strength by default, see :envvar:`WEBLATE_MIN_PASSWORD_SCORE`.
* Improved error reporting in :ref:`machine-translation-setup`.
* :ref:`check-max-size` better displays rendered text.
* Admins can now specify username and full name when :ref:`invite-user`.
Expand Down Expand Up @@ -439,7 +439,7 @@ Released on September 10th 2023.
* Source strings and state display for converted formats.
* Block :ref:`component-edit_template` on formats which do not support it.
* :ref:`check-reused` is no longer triggered for blank strings.
* Performace issues while browsing some categories.
* Performance issues while browsing some categories.
* Fixed GitHub Team and Organization authentication in Docker container.
* GitLab merge requests when using a customized SSH port.

Expand Down
2 changes: 1 addition & 1 deletion docs/formats/android.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stored in a different location from the other files -- :file:`res/values/strings
Weblate does following escaping of strings:

* If a strings is valid XML, it is inserted as XML to translation.
* ``?`` and ``@`` are escaped with a ``\\`` at the beginning of the string to avoid intepreting them as style or resource references.
* ``?`` and ``@`` are escaped with a ``\\`` at the beginning of the string to avoid interpreting them as style or resource references.
* In case string contains multiple spaces, it is quoted with double quotes (``"``).
* Newlines are escaped as ``\\n``, but the actual newline is kept for readability as well.

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ target-version = ['py310']

[tool.codespell]
count = true
skip = '*.po,*.pot,*.json,*.tmx,*.tbx,*.csv,yarn.lock,known_hosts,*/vendor/*'
# TODO: the per-file ignores should use inlines once supported by codespell
skip = '*.po,*.pot,*.json,*.tmx,*.tbx,*.csv,yarn.lock,known_hosts,*/vendor/*,weblate/checks/tests/test_chars_checks.py,weblate/checks/tests/test_fluent_checks.py,weblate/checks/tests/test_format_checks.py,weblate/checks/tests/test_duplicate_checks.py,weblate/checks/tests/test_icu_checks.py,weblate/machinery/aws.py,weblate/machinery/baidu.py,weblate/machinery/apertium.py,weblate/machinery/saptranslationhub.py,weblate/screenshots/views.py,weblate/trans/specialchars.py,weblate/checks/data.py,weblate/machinery/alibaba.py,weblate/formats/base.py,weblate/formats/tests/test_multi.py,weblate/vcs/gpg.py,scripts/yarn/yarn.lock,weblate/trans/tests/data/known_hosts,scripts/generate-specialchars,docs/user/checks.rst'

[tool.django-stubs]
django_settings_module = "weblate.settings_example"
Expand Down Expand Up @@ -344,7 +345,7 @@ ignore = [
"D100", # TODO: Missing docstring in public module
"D101", # TODO: Missing docstring in public class
"D102", # TODO: Missing docstring in public method
"D103", # TODO: Missing docstring in public functio
"D103", # TODO: Missing docstring in public function
"D104", # TODO: Missing docstring in public package
"D105", # TODO: Missing docstring in magic method
"D106", # TODO: Missing docstring in public nested class
Expand Down
2 changes: 1 addition & 1 deletion weblate/checks/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
(?:\d+)? # width
(?:\.\d+)? # precision
(?P<type>
((?<![tT])[tT][A-Za-z]|[A-Za-z])) # type (%s, %d, %te, etc.)
((?<![tT])[tT][A-Za-z]|[A-Za-z])) # type (%s, %d, %td, etc.)
)
)
""",
Expand Down
2 changes: 1 addition & 1 deletion weblate/utils/tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_old_format(self) -> None:

def test_invalid_format(self) -> None:
with self.assertRaises(ValidationError):
validate_editor("editor://open/?file={{ fle }}&line={{ line }}")
validate_editor("editor://open/?file={{ fl }}&line={{ line }}")

def test_no_scheme(self) -> None:
with self.assertRaises(ValidationError):
Expand Down

0 comments on commit d189b19

Please sign in to comment.