Skip to content

Commit

Permalink
Add codespell support (config, workflow to detect/not fix) and make i…
Browse files Browse the repository at this point in the history
…t fix few typos (#54)

* Add github action to codespell main on push and PRs

* Add rudimentary codespell config

* [DATALAD RUNCMD] run codespell throughout fixing few left typos automagically

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
  • Loading branch information
yarikoptic authored Oct 30, 2024
1 parent e7a47a0 commit 0017061
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,.codespellrc
check-hidden = true
# ignore-regex =
ignore-words-list = vor
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

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

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ title = 'Über formal unentscheidbare Sätze der Principia Mathematica und verwa
get_citations_from_title(title)
```

*NOTE*: The scholar endpoint does not require authentification but since it regularly
*NOTE*: The scholar endpoint does not require authentication but since it regularly
prompts with captchas, it's difficult to apply large scale.

### Journal impact factor
Expand Down
2 changes: 1 addition & 1 deletion paperscraper/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def aggregate_paper(
if not isinstance(bins_per_year, int):
raise ValueError(f"Expected int, received {type(bins_per_year)}")
if 12 % bins_per_year != 0:
raise ValueError(f"Cant split year into {bins_per_year} bins")
raise ValueError(f"Can't split year into {bins_per_year} bins")

num_years = last_year - start_year + 1
bins = np.zeros((num_years * bins_per_year))
Expand Down

0 comments on commit 0017061

Please sign in to comment.