Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codespell support (config, pre-commit), workflow + and make it fix some typos #254

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
# Configuration for codespell is in pyproject.toml
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Overview
========

typohere: ot

Check failure on line 5 in README.rst

View workflow job for this annotation

GitHub Actions / Check for spelling errors

ot ==> to, of, or, not

.. start-badges

.. list-table::
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Why is my ``StdDev`` so high?
Why is my ``Min`` way lower than ``Q1-1.5IQR``?
You may see this issue in the histogram plot. This is another instance of *bad isolation*.

For example, Intel CPUs have a feature called `Turbo Boost <https://en.wikipedia.org/wiki/Intel_Turbo_Boost>`_ wich
For example, Intel CPUs have a feature called `Turbo Boost <https://en.wikipedia.org/wiki/Intel_Turbo_Boost>`_ which
overclocks your CPU depending on how many cores you have at that time and how hot your CPU is. If your CPU is too hot you get
no Turbo Boost. If you get Turbo Boost active then the CPU quickly gets hot. You can see how this won't work for sustained
workloads.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Notable features and goals:
* Sensible defaults and automatic calibration for microbenchmarks
* Good integration with pytest
* Comparison and regression tracking
* Exhausive statistics
* Exhaustive statistics
* JSON export

Examples:
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ You can set per-test options with the ``benchmark`` marker:
Extra info
==========

You can set arbirary values in the ``benchmark.extra_info`` dictionary, which
You can set arbitrary values in the ``benchmark.extra_info`` dictionary, which
will be saved in the JSON if you use ``--benchmark-autosave`` or similar:

.. code-block:: python
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ skip-string-normalization = true

[tool.ruff.flake8-quotes]
inline-quotes = "single"

# Ref: https://github.com/codespell-project/codespell#using-a-config-file
[tool.codespell]
skip = '.git,*.pdf,*.svg,go.sum'
check-hidden = true
# ignore-regex = ''
# name and unfortunate choices for a few variables
ignore-words-list = 'daa,serie,splitted'
2 changes: 1 addition & 1 deletion tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def pytest_benchmark_update_machine_info(config, machine_info):
simple_test = """
def test_simple(benchmark):
@benchmark
def resuilt():
def result():
1+1
"""

Expand Down
Loading