Skip to content

Commit

Permalink
Merge pull request #107 from yarikoptic/enh-codespell
Browse files Browse the repository at this point in the history
Add codespell: pre-commit config, config, and dedicated GH action; fix 2 typos
  • Loading branch information
yarikoptic committed Mar 20, 2024
2 parents c053aeb + e7faec9 commit 5c3e29e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codespell configuration is within pyproject.toml
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ repos:
- flake8-bugbear
- flake8-builtins
- flake8-unused-arguments

- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 1 addition & 1 deletion _datalad_buildsupport/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _mk_title(self, prog):

def _mk_name(self, prog, desc):
"""
this method is in consitent with others ... it relies on
this method is in consistent with others ... it relies on
distribution
"""
desc = desc.splitlines()[0] if desc else 'it is in the name'
Expand Down
2 changes: 1 addition & 1 deletion datalad_fuse/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
# TAG-NUM-gHEX
mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
if not mo:
# unparseable. Maybe git-describe is misbehaving?
# unparsable. Maybe git-describe is misbehaving?
pieces["error"] = ("unable to parse git-describe output: '%s'"
% describe_out)
return pieces
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git,*.pdf,venvs,locale,.tox,versioneer.py,*.lock,*.css,data'
check-hidden = true
# ignore-regex = ''
ignore-words-list = 'gameboy'

0 comments on commit 5c3e29e

Please sign in to comment.