Skip to content
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
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 pyproject.toml
---
name: Codespell

on:
push:
branches: [develop]
pull_request:
branches: [develop]

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
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ repos:
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ If you encounter a bug, have a technical question, or want to request a feature,
at help@osf.io. While we may respond to questions through other channels, reaching out to us at help@osf.io ensures
that your feedback goes to the right person promptly. If you're considering posting an issue on our GitHub issues page,
we recommend sending it to help@osf.io instead.
avaialable
2 changes: 1 addition & 1 deletion addon_service/common/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def extract_filter_expressions(
Since no formal JSON:API scheme exists for complex filter operations, we have settled on the following norm:
Filter params can have either one or two arguments.
The first argument MUST be a field on the serialized output of the endpoint
The second arugment is an OPTIONAL comparison operator (i.e. `icontains`, `lte`, etc.)
The second argument is an OPTIONAL comparison operator (i.e. `icontains`, `lte`, etc.)

>>> from addon_service.models import UserReference
>>> class DemoSerializer(serializers.Serializer):
Expand Down
2 changes: 1 addition & 1 deletion addon_service/common/jsonapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __str__(self):
def group_query_params_by_family(
query_items: Iterable[tuple[str, Iterable[str] | str]]
) -> QueryParamFamilies:
"""Extracts JSON:API query familes from a list of (ParameterName, ParameterValues) tuples.
"""Extracts JSON:API query families from a list of (ParameterName, ParameterValues) tuples.

Data should be pre-normalized before calling, such as by using the results of
`urllib.parse.parse_qs(...).items()` or `django.utils.QueryDict.lists()`
Expand Down
2 changes: 1 addition & 1 deletion addon_service/common/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RestrictedReadOnlyViewSet(ReadOnlyModelViewSet):
`v1/user-references/?filter[user_uri]={uri}`
to act as an alternative to
`v1/user-references/{pk}`
in the case where the caller only has the publicly avaialable uri as a key
in the case where the caller only has the publicly available uri as a key
"""

def list(self, request, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion addon_service/oauth2/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def validate_shared_client(self):
)
if len(client_configs) != 1:
raise ValidationError(
"OAuth2 Token Metadata is linked to mulitple services/clients"
"OAuth2 Token Metadata is linked to multiple services/clients"
)

@sync_to_async
Expand Down
2 changes: 1 addition & 1 deletion addon_service/tests/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MockOSF:
def __init__(self, permissions=None):
"""A lightweight, configurable mock of OSF for testing remote permissions.

Accepts a mapping of arbitrary resource_uris to user permissiosn and `public` status
Accepts a mapping of arbitrary resource_uris to user permissions and `public` status
{
'osf.io/abcde': {'osf.io/bcdef': 'write', 'osf.io/cdefg': 'admin', 'public': True},
'osf.io/zyxwv': {'osf.io/yxwvut': 'read', 'public': False}
Expand Down
4 changes: 2 additions & 2 deletions addon_toolkit/declarator.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ClassDeclarator(Declarator):
with shorthand declarator:
>>> semver = ClassDeclarator(SemanticVersionDeclaration, field_for_subject='subj')

for declarating classes:
for declaring classes:
>>> @semver(
... major=4,
... minor=2,
Expand All @@ -152,7 +152,7 @@ class ClassDeclarator(Declarator):
...
ValueError: no declaration found for <class 'addon_toolkit.declarator.Foo'>

to recognize a subclass of a declarated class, use `get_declaration_for_class` (returns the first declaration found on items in `__mro__`)
to recognize a subclass of a declared class, use `get_declaration_for_class` (returns the first declaration found on items in `__mro__`)
>>> semver.get_declaration_for_class(Foo)
SemanticVersionDeclaration(major=4, minor=2, patch=9, subj=<class 'addon_toolkit.declarator.MyLongLivedBaseClass'>)

Expand Down
2 changes: 1 addition & 1 deletion addon_toolkit/imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_operation_declaration(
return _operation

@classmethod
def confirm_credentials(cls, crendentials): ...
def confirm_credentials(cls, credentials): ...

###
# instance methods
Expand Down
2 changes: 1 addition & 1 deletion addon_toolkit/tests/_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def load_doctests(*modules):
load_tests = load_doctests(my.module.with.doctests)
```

(if there's a need, could support pass-thru kwargs to DocTestSuite)
(if there's a need, could support pass-through kwargs to DocTestSuite)
"""

def _load_tests(loader, tests, pattern):
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ newrelic = "^10.2.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git*,*.svg,*.lock'
check-hidden = true
ignore-regex = '\bassertIn\b'
# ignore-words-list = ''