mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
Check spelling with codespell, closes #307
This commit is contained in:
parent
f7c8c78cd0
commit
991cf56ae2
5 changed files with 31 additions and 5 deletions
25
.github/workflows/spellcheck.yml
vendored
Normal file
25
.github/workflows/spellcheck.yml
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
name: Check spelling in documentation
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
spellcheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- uses: actions/cache@v2
|
||||
name: Configure pip caching
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -e '.[docs]'
|
||||
- name: Check spelling
|
||||
run: codespell docs/*.rst --ignore-words docs/codespell-ignore-words.txt
|
||||
|
|
@ -361,7 +361,7 @@ Passing ``--save other.db`` will instead use that SQL to populate a new database
|
|||
|
||||
% sqlite-utils memory dogs.csv --save dogs.db
|
||||
|
||||
These features are mainly intented as debugging tools - for much more finely grained control over how data is inserted into a SQLite database file see :ref:`cli_inserting_data` and :ref:`cli_insert_csv_tsv`.
|
||||
These features are mainly intended as debugging tools - for much more finely grained control over how data is inserted into a SQLite database file see :ref:`cli_inserting_data` and :ref:`cli_insert_csv_tsv`.
|
||||
|
||||
.. _cli_rows:
|
||||
|
||||
|
|
@ -617,7 +617,7 @@ The ``_analyze_tables_`` table has the following schema::
|
|||
PRIMARY KEY ([table], [column])
|
||||
);
|
||||
|
||||
The ``most_common`` and ``least_common`` columns will contain nested JSON arrays of the most commond and least common values that look like this::
|
||||
The ``most_common`` and ``least_common`` columns will contain nested JSON arrays of the most common and least common values that look like this::
|
||||
|
||||
[
|
||||
["Del Libertador, Av", 5068],
|
||||
|
|
|
|||
1
docs/codespell-ignore-words.txt
Normal file
1
docs/codespell-ignore-words.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
AddWordsToIgnoreHere
|
||||
|
|
@ -1096,7 +1096,7 @@ Here's an example of this mechanism in action:
|
|||
])
|
||||
db["books"].add_foreign_key("author_id", "authors", "id")
|
||||
|
||||
The ``table.add_foreign_key(column, other_table, other_column)`` method takes the name of the column, the table that is being referenced and the key column within that other table. If you ommit the ``other_column`` argument the primary key from that table will be used automatically. If you omit the ``other_table`` argument the table will be guessed based on some simple rules:
|
||||
The ``table.add_foreign_key(column, other_table, other_column)`` method takes the name of the column, the table that is being referenced and the key column within that other table. If you omit the ``other_column`` argument the primary key from that table will be used automatically. If you omit the ``other_table`` argument the table will be guessed based on some simple rules:
|
||||
|
||||
- If the column is of format ``author_id``, look for tables called ``author`` or ``authors``
|
||||
- If the column does not end in ``_id``, try looking for a table with the exact name of the column or that name with an added ``s``
|
||||
|
|
@ -2327,7 +2327,7 @@ Exceptions that occur inside a user-defined function default to returning the fo
|
|||
|
||||
Unexpected error: user-defined function raised exception
|
||||
|
||||
You can cause ``sqlite3`` to return more useful errors, including the traceback from the custom function, by executing the following before your custom fuctions are executed:
|
||||
You can cause ``sqlite3`` to return more useful errors, including the traceback from the custom function, by executing the following before your custom functions are executed:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -32,7 +32,7 @@ setup(
|
|||
setup_requires=["pytest-runner"],
|
||||
extras_require={
|
||||
"test": ["pytest", "black", "hypothesis"],
|
||||
"docs": ["sphinx_rtd_theme", "sphinx-autobuild"],
|
||||
"docs": ["sphinx_rtd_theme", "sphinx-autobuild", "codespell"],
|
||||
"mypy": ["mypy", "types-click", "types-tabulate", "types-python-dateutil"],
|
||||
"flake8": ["flake8"],
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue