Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Merge 80b337b into a879f5c
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Jan 4, 2023
2 parents a879f5c + 80b337b commit e151de9
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 123 deletions.
6 changes: 0 additions & 6 deletions .bumpversion.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- '3.10'
- '3.11'
steps:
- uses: actions/checkout@v2
- name: Set up Python v${{ matrix.python-version }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
name: Documentation build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python v3.7
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt-get install hunspell \
Expand All @@ -36,5 +36,5 @@ jobs:
-d _build/doctrees \
-D language=en \
. _build/html
- name: Show tree
- name: Show documentation tree
run: tree docs/_build/html
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: '3.10'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit autoupdate
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: '3.10'
- name: Run pre-commit
uses: pre-commit/action@v2.0.3
4 changes: 2 additions & 2 deletions .github/workflows/update-copyright-years.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
update-license-year:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: FantasticFiasco/action-update-license-year@v2
Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
needs: update-license-year
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: FantasticFiasco/action-update-license-year@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/.pytest_cache
/*.egg-info
__pycache__
/docs/_build/
40 changes: 9 additions & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,71 +1,49 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v3.3.1
hooks:
- id: pyupgrade
args:
- --py36-plus
- --py37-plus
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: end-of-file-fixer
name: end-of-file-fixer
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.12.0
hooks:
- id: black
language_version: python3
files: \.py$
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
name: flake8-package
additional_dependencies:
- flake8-print
- flake8-implicit-str-concat
files: ^hunspellcheck/
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
name: flake8-tests
additional_dependencies:
- flake8-print
- flake8-implicit-str-concat
files: ^tests/
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort
args:
- --filter-files
files: \.py$
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
rev: v1.28.0
hooks:
- id: yamllint
files: .+\.(yml|yaml)
args:
- -c
- .yamllint
- repo: https://github.com/mondeja/repo-stream
rev: v1.3.1
hooks:
- id: repo-stream
args:
- -config=https://github.com/mondeja/repo-stream-config
- -updater=upstream
- repo: https://github.com/mondeja/pre-commit-hooks
rev: v1.5.2
rev: v1.8.0
hooks:
- id: dev-extras-required
- id: root-editorconfig-required
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.4.0
rev: 2.6.2
hooks:
- id: editorconfig-checker
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

python:
version: 3.7
version: '3.8'
install:
- method: pip
path: .
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[license-image]: https://img.shields.io/pypi/l/hunspellcheck?color=light-green&logo=freebsd&logoColor=whiite
[license-link]: https://github.com/mondeja/hunspellcheck/blob/master/LICENSE

[tests-image]: https://img.shields.io/github/workflow/status/mondeja/hunspellcheck/CI?logo=github&label=tests
[tests-image]: https://img.shields.io/github/actions/workflow/status/mondeja/hunspellcheck/ci.yml?branch=master&logo=github&label=tests
[tests-link]: https://github.com/mondeja/hunspellcheck/actions?query=workflow%3ACI
[documentation-image]: https://img.shields.io/readthedocs/hunspellcheck?logo=read-the-docs&logoColor=white
[documentation-link]: https://hunspellcheck.readthedocs.io
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"jinja2": ("https://jinja2docs.readthedocs.io/en/stable", None),
"jinja2": ("https://jinja.palletsprojects.com/en/latest/", None),
"babel": ("http://babel.pocoo.org/en/latest", None),
"hunspellcheck": ("http://hunspellcheck.readthedocs.io/en/latest", None),
}
2 changes: 1 addition & 1 deletion hunspellcheck/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from hunspellcheck.word import looks_like_a_word_creator


__version__ = "0.0.8"
__version__ = "0.1.0"
__title__ = "hunspellcheck"
__all__ = (
"HunspellChecker",
Expand Down
36 changes: 19 additions & 17 deletions hunspellcheck/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ def hunspellchecker_argument_parser(
constructing the ``-l/--language`` option.
negotiate_languages (bool): Enables the language negotiation. If this
is enabled and the CLI consumer passes a locale code instead of
a full language name (for example `es` instead of `es_ES`),
hunspellcheck will convert `es` to a territorialized language
a full language name (for example ``es`` instead of ``es_ES``),
hunspellcheck will convert ``es`` to a territorialized language
dictionary name available using the function
:py:meth:`babel.core.Locale.negotiate`. If is disabled, a language
dictionary passed as locale code like `es` will be considered
dictionary passed as locale code like ``es`` will be considered
invalid.
personal_dicts (bool): Include the ``-p/--personal-dict`` option inside
the argument parser.
Expand All @@ -169,7 +169,7 @@ def hunspellchecker_argument_parser(
:py:meth:`argparse.ArgumentParser.add_argument`.
digits_are_words_kwargs (dict): Optional kwargs which override default
kwargs passed to :py:meth:`argparse.ArgumentParser.add_argument`
building the ``--digits-are-words` option.
building the ``--digits-are-words`` option.
words_not_contain_digits (bool): Include the option
``--words-not-contain-digits`` which when passed in a CLI, the
words that contain digits will be ignored mispellchecking errors.
Expand All @@ -179,7 +179,7 @@ def hunspellchecker_argument_parser(
words_not_contain_digits_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--words-not-contain-digits` option.
``--words-not-contain-digits`` option.
words_not_startswith_dash (bool): Include the option
``--words-not-startswith-dash`` which when passed in a CLI, the
words starting with character ``"-" `` will be ignored
Expand All @@ -190,7 +190,7 @@ def hunspellchecker_argument_parser(
words_not_startswith_dash_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--words-not-startswith-dash` option.
``--words-not-startswith-dash`` option.
words_not_endswith_dash (bool): Include the option
``--words-not-endswith-dash`` which when passed in a CLI, the
words ending with character ``"-" `` will be ignored
Expand All @@ -201,7 +201,7 @@ def hunspellchecker_argument_parser(
words_not_endswith_dash_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--words-not-endswith-dash` option.
``--words-not-endswith-dash`` option.
words_not_contain_dash (bool): Include the option
``--words-not-contain-dash`` which when passed in a CLI, the
words containing character ``"-" `` will be ignored mispellchecking
Expand All @@ -212,7 +212,7 @@ def hunspellchecker_argument_parser(
words_not_contain_dash_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--words-not-contain-dash` option.
``--words-not-contain-dash`` option.
words_not_contain_two_upper (bool): Include the option
``--words-not-contain-two-upper`` which when passed in a CLI, the
words containing two uppercase letters or mote will be ignored
Expand All @@ -223,7 +223,7 @@ def hunspellchecker_argument_parser(
words_not_contain_two_upper_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--words-not-contain-two-upper` option.
``--words-not-contain-two-upper`` option.
no_include_filename (bool): Include the option
``--no-include-filename`` which when passed in a CLI, the path to
files in which mispelling errors are found are not shown in
Expand All @@ -234,7 +234,7 @@ def hunspellchecker_argument_parser(
no_include_filename_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--no-include-filename` option.
``--no-include-filename`` option.
no_include_line_number (bool): Include the option
``--no-include-line-number`` which when passed in a CLI, the number
of lines in which mispelling errors are found are not shown in
Expand All @@ -245,7 +245,7 @@ def hunspellchecker_argument_parser(
no_include_line_number_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--no-include-line-number` option.
``--no-include-line-number`` option.
no_include_word (bool): Include the option
``--no-include-word`` which when passed in a CLI, the words
in which mispelling errors are found are not shown in the output.
Expand All @@ -255,7 +255,7 @@ def hunspellchecker_argument_parser(
no_include_word_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--no-include-word` option.
``--no-include-word`` option.
no_include_word_line_index (bool): Include the option
``--no-include-word-line-index`` which when passed in a CLI, the
index of the mispelled words inside their lines in which mispelling
Expand All @@ -266,7 +266,7 @@ def hunspellchecker_argument_parser(
no_include_word_line_index_kwargs (dict): Optional kwargs which
override default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--no-include-word-line-index` option.
``--no-include-word-line-index`` option.
include_line (bool): Include the option ``--include-line`` which when
passed in a CLI, the line of the mispelled words in which
mispelling errors are found are shown in the output.
Expand All @@ -275,7 +275,7 @@ def hunspellchecker_argument_parser(
:py:meth:`argparse.ArgumentParser.add_argument`.
include_line_kwargs (dict): Optional kwargs which override default
kwargs passed to :py:meth:`argparse.ArgumentParser.add_argument`
building the ``--include-line` option.
building the ``--include-line`` option.
include_text (bool): Include the option ``--include-text`` which when
passed in a CLI, the text in which reside found mispelled words
is shown in the output.
Expand All @@ -284,7 +284,7 @@ def hunspellchecker_argument_parser(
:py:meth:`argparse.ArgumentParser.add_argument`.
include_text_kwargs (dict): Optional kwargs which override default
kwargs passed to :py:meth:`argparse.ArgumentParser.add_argument`
building the ``--include-text` option.
building the ``--include-text`` option.
include_error_number (bool): Include the option
``--include-error-number`` which when passed in a CLI, the number
of each error is shown in the output.
Expand All @@ -294,7 +294,7 @@ def hunspellchecker_argument_parser(
include_error_number_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--include-error-number` option.
``--include-error-number`` option.
include_near_misses (bool): Include the option
``--include-near-misses`` which when passed in a CLI, some Hunspell
suggestions will be shown for each mispelled word in the report.
Expand All @@ -304,9 +304,10 @@ def hunspellchecker_argument_parser(
include_near_misses_kwargs (dict): Optional kwargs which override
default kwargs passed to
:py:meth:`argparse.ArgumentParser.add_argument` building the
``--include-near-misses` option.
``--include-near-misses`` option.
Examples:
>>> import argparse
>>>
>>> parser = argparse.ArgumentParser()
Expand All @@ -317,6 +318,7 @@ def hunspellchecker_argument_parser(
>>> opts = parser.parse_args(["--language", "es"])
>>> print(opts)
Namespace(languages=["es_ES"])
"""
if version:
version_string = render_version_template(
Expand Down
2 changes: 1 addition & 1 deletion hunspellcheck/hunspell/dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def gen_available_dictionaries(full_paths=False):
output = subprocess.run(
["hunspell", "-D"],
stderr=subprocess.PIPE,
universal_newlines=True,
text=True,
)

if previous_env_lang is None:
Expand Down
2 changes: 1 addition & 1 deletion hunspellcheck/hunspell/spellcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def hunspell_spellcheck(

response = subprocess.run(
command,
universal_newlines=True,
text=True,
input=content,
stdout=subprocess.PIPE,
check=True,
Expand Down
2 changes: 1 addition & 1 deletion hunspellcheck/hunspell/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_hunspell_version(hunspell=True, ispell=True):
output = subprocess.run(
["hunspell", "--version"],
stdout=subprocess.PIPE,
universal_newlines=True,
text=True,
)

if previous_env_lang is None:
Expand Down

0 comments on commit e151de9

Please sign in to comment.