Skip to content

Commit

Permalink
Merge pull request #15 from py-mine/add-codespell
Browse files Browse the repository at this point in the history
Add codespell
  • Loading branch information
ItsDrike committed Dec 30, 2022
2 parents 785b926 + 1387dd3 commit 2d9cacf
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
with:
token: ${{ steps.generate_token.outputs.token }}

# Make the github application be the comitter
# (see: https://stackoverflow.com/a/74071223 on how to obtain the comitter email)
# Make the github application be the committer
# (see: https://stackoverflow.com/a/74071223 on how to obtain the committer email)
- name: Setup git config
run: |
git config --global user.name "py-mine-ci-bot"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
install_args: "--without release"

- name: Run pre-commit hooks
run: SKIP=black,isort,flake8,slotscheck,pyright pre-commit run --all-files
run: SKIP=black,isort,flake8,slotscheck,codespell,pyright pre-commit run --all-files

- name: Run black formatter check
run: black --check --diff .
Expand All @@ -38,6 +38,9 @@ jobs:
- name: Run flake8 linter
run: flake8 .

- name: Run codespell linter
run: codespell .

- name: Run slotscheck
run: slotscheck -m mcproto

Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ repos:
language: system
types: [python]

- repo: local
hooks:
- id: codespell
name: CodeSpell
description: Run code spell checker
entry: poetry run codespell
language: system


- repo: local
hooks:
- id: slotscheck
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Methods of marking PR as a draft:
1. When creating it

![image](https://user-images.githubusercontent.com/20902250/94499351-bc736e80-01fc-11eb-8e99-a7863dd1428a.png)
2. After it was crated
2. After it was created

![image](https://user-images.githubusercontent.com/20902250/94499276-8930df80-01fc-11eb-9292-7f0c6101b995.png)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async def handshake(conn: TCPAsyncConnection, ip: str, port: int = 25565) -> Non

# And now, it's time to send it!
await conn.write_varint(len(packet)) # First field (size of packet id + data)
await conn.write(packet) # Second + Third fileds (packet id + data)
await conn.write(packet) # Second + Third fields (packet id + data)


async def status(conn: TCPAsyncConnection, ip: str, port: int = 25565) -> dict:
Expand Down
1 change: 1 addition & 0 deletions changes/15.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add codespell tool, to automatically find spelling mistakes.
19 changes: 18 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pep8-naming = "^0.12.1"
black = "^22.3.0"
isort = "^5.10.1"
pyright = "^1.1.239"
codespell = {extras = ["tomli"], version = "^2.2.2"}
slotscheck = "^0.16.1"

[tool.poetry.group.release.dependencies]
Expand All @@ -85,6 +86,10 @@ order_by_type = false
case_sensitive = true
combine_as_imports = true

[tool.codespell]
skip = "./.venv/*,./htmlcov/*,./.git,./.mypy_cache/*,./.pytest_cache/*"
ignore-words-list = "ned"

[tool.pytest.ini_options]
minversion = "6.0"
asyncio_mode = "auto"
Expand Down Expand Up @@ -153,6 +158,7 @@ black = "black ."
isort = "isort ."
pyright = "pyright ."
flake8 = "flake8 ."
codespell = "codespell ."
slotscheck = "slotscheck -m mcproto"
test = "pytest -v --failed-first"
retest = "pytest -v --last-failed"
Expand Down

0 comments on commit 2d9cacf

Please sign in to comment.