Skip to content

Commit

Permalink
Add codespell: config, workflow (to alert when new typos added) and g…
Browse files Browse the repository at this point in the history
…et typos fixed (#302)

* Add github action to codespell master on push and PRs

* Add rudimentary codespell config

* remove spurious space added in d79fe14

* ignore logs

* [DATALAD RUNCMD] run codespell throughout but ignore fail

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w || :",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

* [DATALAD RUNCMD] Do interactive fixing of some ambigous typos

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
  • Loading branch information
yarikoptic committed Dec 9, 2023
1 parent 64f3812 commit 056831c
Show file tree
Hide file tree
Showing 31 changed files with 69 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ or using Python's builtin `venv` instead of `virtualenvwrapper`:
```
The new environment exists and is activated.
Now install the development dependencies into that environemt:
Now install the development dependencies into that environment:
```
(wsgidav_py34) $ pip install -r requirements-dev.txt
```
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
[symlinks may be a security risk](https://serverfault.com/questions/244592/followsymlinks-on-apache-why-is-it-a-security-risk).<br>
File resources that are symlinks are still enumerated and listed by the
directory browser. However trying to access content will raise '403 Forbidden'
Pass _follow_symlinks=True_ to the FilesystemProvider constructor or yaml configration
Pass _follow_symlinks=True_ to the FilesystemProvider constructor or yaml configuration
to restore the previous behavior.
- Add `fs_dav_provider.shadow_map`, which can be used to blend in a favicon
when context is opened inline (#230)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Martin Wendt:

* St�phane Klein for many contributions and testing on Mac

* All other contributers:
* All other contributors:
http://code.google.com/p/wsgidav/people/list
https://github.com/mar10/wsgidav/graphs/contributors

Expand Down
2 changes: 1 addition & 1 deletion docs/source/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
..
Custom formatting of module doc layout
https://stackoverflow.com/questions/48074094/use-sphinx-autosummary-recursively-to-generate-api-documentation
TODO: how can we add the documented module attribuets (constants, ...)?
TODO: how can we add the documented module attributes (constants, ...)?
.. rubric:: Description

Expand Down
2 changes: 1 addition & 1 deletion docs/source/addons-mercurial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Usage
-----
.. note:: This is **not** production code.

To publish a Mercurial repository by the share name 'hg', simply add thes lines
To publish a Mercurial repository by the share name 'hg', simply add these lines
to the configuration file::

# Publish a Mercurial repository
Expand Down
2 changes: 1 addition & 1 deletion docs/source/addons-mysql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The table's columns are mad accessible as live properties:

Usage
-----
To publish an MySQL database, simply add thes lines to the configuration file::
To publish an MySQL database, simply add these lines to the configuration file::

### Publish an MySQL 'world' database as share '/world-db'
from wsgidav.samples.mysql_dav_provider import MySQLBrowserProvider
Expand Down
2 changes: 1 addition & 1 deletion docs/source/addons-virtual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contains some virtual files with additional information:

Usage
-----
To publish the sample virtual resources, simply add thes lines to the
To publish the sample virtual resources, simply add these lines to the
configuration file::

# Publish a virtual structure
Expand Down
2 changes: 1 addition & 1 deletion docs/source/changelog04.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Also, the config file is optional, i.e. the server runs also with command line o

<li>
Property manager<br>
Removed propertylibrary helper fuctions (only !PropManager class left).<br>
Removed propertylibrary helper functions (only !PropManager class left).<br>
Add property functions to davProvider
getProperties() returns (name, value) tuples, where value is etree.Element
or HTTPRequestException().<br>
Expand Down
6 changes: 3 additions & 3 deletions docs/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ committing the changes. The pull request will then need to be approved before i
.. note::

Don't mix different topics in a single commit or issue. Instead submit a new pull request (and
even create separate branches as apropriate).
even create separate branches as appropriate).


Setup for Development
Expand All @@ -120,7 +120,7 @@ Create and Activate a Virtual Environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Virtual environments allow us to develop and test in a sandbox, without affecting our
system othwerwise. |br|
system otherwise. |br|
We need `Python 2.7 <https://www.python.org/downloads/>`_,
`Python 3.4+ <https://www.python.org/downloads/>`_,
and `pip <https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip>`_ on our system.
Expand Down Expand Up @@ -183,7 +183,7 @@ Hack, Hack, Hack
Since version 3.x source formatting rules are delegated to the
`Black library <https://black.readthedocs.io/en/stable/>`_.

Failing tests or not follwing PEP 8 will break builds on
Failing tests or not following PEP 8 will break builds on
`travis <https://app.travis-ci.com/github/mar10/wsgidav>`_ and therefore be
automatically rejected:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ If everything is cool, this should work now::
Windows
-------

Install the preconditions if neccessary.
Install the preconditions if necessary.
Basically the same as for `Linux / macOS`_

.. note::
Expand Down
6 changes: 3 additions & 3 deletions docs/source/user_guide_access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Redirector
The easiest way to access a WebDAV share from a Windows client is probably
to map it as a network drive, and then use the File Explorer.

If the share allows anonymous access, type this at the command promt::
If the share allows anonymous access, type this at the command prompt::

> net use W: http://192.168.0.2/
> dir W:
Expand Down Expand Up @@ -67,7 +67,7 @@ To stop a connection::

**Known issues on all Windows versions**

* See als greenbytes `WebDAV Mini-Redirector (MRXDAV.SYS) Versions and Issues
* See also greenbytes `WebDAV Mini-Redirector (MRXDAV.SYS) Versions and Issues
List <http://greenbytes.de/tech/webdav/webdav-redirector-list.html>`_.

* The WebDAV server must respond to PROPFIND and OPTIONS requests at the root
Expand Down Expand Up @@ -145,7 +145,7 @@ Microsoft's "WebFolder" client predates Windows XP's WebDAV Redirector.
.. note::
Some known quirks of Microsoft's "WebFolder" client are listed below.

See als greenbytes `Web Folder Client (MSDAIPP.DLL) Versions and Issues List
See also greenbytes `Web Folder Client (MSDAIPP.DLL) Versions and Issues List
<http://greenbytes.de/tech/webdav/webfolder-client-list.html>`_.


Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide_configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Three syntax variants are supported:
2. ``<share_path>: { "root": <folder_path>, "readonly": <bool> }``:
use ``FilesystemProvider(folder_path, readonly)``
3. ``<share_path>: { "class": <class_path>, args: [arg, ...], kwargs: {"arg1": val1, "arg2": val2, ... }}``
Instantiate a custom class (derrived from ``DAVProvider``) using named
Instantiate a custom class (derived from ``DAVProvider``) using named
kwargs.

..
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ src_paths = ["wsgidav", "tests"]
# [tool.flake8]
# Flake8 currently does not support pyproject.toml.
# See [flake8] section in setup.cfg instead.

[tool.codespell]
skip = '.git,*.pdf,*.svg,*.lock,*.css,logs'
check-hidden = true
# ignore-regex = ''
# ignore-words-list = ''
4 changes: 2 additions & 2 deletions sample_wsgidav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ provider_mapping:
path: '/path/to/share3'
another_arg: 42

#: Addional configuration passed to `FilesystemProvider(..., fs_opts)`
#: Additional configuration passed to `FilesystemProvider(..., fs_opts)`
fs_dav_provider:
#: Mapping from request URL to physical file location, e.g.
#: make sure that a `/favicon.ico` URL is resolved, even if a `*.html`
Expand Down Expand Up @@ -246,7 +246,7 @@ property_manager: null

#: Optional additional live property modification
#: Note: by default live properties like file size and last-modified time are
#: read-only, but that can be overriden here if the underlying DAV provider
#: read-only, but that can be overridden here if the underlying DAV provider
#: supports it. For now only the FileSystemProvider supports it and only namely
#: changes to the last-modified timestamp. Enable it with the mutable_live_props
#: list as below to allow clients to use the utime system call or e.g. the
Expand Down
2 changes: 1 addition & 1 deletion setup_bdist_msi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# NOTE: isort must not chage this import order:
# NOTE: isort must not change this import order:
# isort: skip_file

import os
Expand Down
2 changes: 1 addition & 1 deletion tests/davclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def object_to_etree(parent, obj, namespace=""):

elif type(obj) is dict:
# If the object is a dictionary we"ll need to parse it and send it back
# recusively
# recursively
for key, value in obj.items():
if key.startswith("{") is False:
key_etree = ElementTree.SubElement(parent, "{%s}%s" % (namespace, key))
Expand Down
2 changes: 1 addition & 1 deletion tests/stressor/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ $
### Cheroot v8.1.0

**2.9k activities per 30 sec**
**Major Preformance Drop Introduced with v8.1.0**
**Major Performance Drop Introduced with v8.1.0**
```
$ stressor run tests/stressor/test_rw.yaml -q
23:00:22.793 <4745440704> NOTE All 10 sessions running, waiting for them to terminate...
Expand Down
2 changes: 1 addition & 1 deletion tests/stressor/test_rw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sequences:

# - activity: $debug()

# Other sections can have arbitrary names and are excuted in order of appearance
# Other sections can have arbitrary names and are executed in order of appearance
main:
# Test dirbrowser for root URL
- activity: GetRequest
Expand Down
6 changes: 3 additions & 3 deletions tests/test_litmus.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _report_missing_litmus(self, extra=""):
raise unittest.SkipTest(f"Test requires litmus test suite{extra}")

def test_litmus_with_authentication(self):
"""Run litmus test suite on HTTP with authentification."""
"""Run litmus test suite on HTTP with authentication."""
with WsgiDavTestServer(with_auth=True, with_ssl=False):
try:
res = subprocess.call(
Expand All @@ -117,7 +117,7 @@ def test_litmus_with_authentication(self):
return

def test_litmus_anonymous(self):
"""Run litmus test suite on HTTP with authentification."""
"""Run litmus test suite on HTTP with authentication."""
with WsgiDavTestServer(with_auth=False, with_ssl=False):
try:
res = subprocess.call(["litmus", "http://127.0.0.1:8080/"])
Expand All @@ -128,7 +128,7 @@ def test_litmus_anonymous(self):
return

def test_litmus_with_ssl_and_authentication(self):
"""Run litmus test suite on SSL / HTTPS with authentification."""
"""Run litmus test suite on SSL / HTTPS with authentication."""
with WsgiDavTestServer(with_auth=True, with_ssl=True):
try:
res = subprocess.call(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def begin_write(self, *, content_type=None):
# print("begin_write: {}".format(self.target_path))
queue = FileLikeQueue(max_size=1)

# Simulate an asynchrounous consumer. We use a file, so we can check
# Simulate an asynchronous consumer. We use a file, so we can check
# the result from the parent unittest process. In real live this could be
# requests.post(..., data=queue), ...
def _consumer():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def testDefault(self):
# No output should be generated in the root logger
assert rootOutput == ""
# The library logger should default to INFO level
# (this output will not be visble, because the base logger only has a NullHandler)
# (this output will not be visible, because the base logger only has a NullHandler)
assert ".debug" not in baseOutput
assert ".info" in baseOutput
assert ".warning" in baseOutput
Expand All @@ -256,7 +256,7 @@ def testEnablePropagation(self):
# Now output we should see output in the root logger
assert rootOutput == baseOutput
# The library logger should default to INFO level
# (this output will not be visble, because the base logger only has a NullHandler)
# (this output will not be visible, because the base logger only has a NullHandler)
assert ".debug" not in baseOutput
assert ".info" in baseOutput
assert ".warning" in baseOutput
Expand Down
6 changes: 3 additions & 3 deletions wsgidav/dav_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def get_ref_url(self):
return quote(self.provider.share_path + self.get_preferred_path())

# def getRefKey(self):
# """Return an unambigous identifier string for a resource.
# """Return an unambiguous identifier string for a resource.
#
# Since it is always unique for one resource, <refKey> is used as key for
# the lock- and property storage dictionaries.
Expand Down Expand Up @@ -830,7 +830,7 @@ def set_property_value(self, name, value, *, dry_run=False):
raise DAVError(HTTP_FORBIDDEN)

# Handle MS Windows Win32LastModifiedTime, if enabled.
# Note that the WebDAV client in Win7 and earler has issues and can't be used
# Note that the WebDAV client in Win7 and earlier has issues and can't be used
# with this so we ignore older clients. Others pre-Win10 should be tested.
if name.startswith("{urn:schemas-microsoft-com:}"):
agent = self.environ.get("HTTP_USER_AGENT", "None")
Expand Down Expand Up @@ -1100,7 +1100,7 @@ def copy_move_single(self, dest_path, *, is_move):
- Live properties should be moved too (e.g. creationdate)
- Non-collections must be moved, not copied
- For collections, this function behaves like in copy-mode:
detination collection must be created and properties are copied.
destination collection must be created and properties are copied.
Members are NOT created.
The source collection MUST NOT be removed.
Expand Down
2 changes: 1 addition & 1 deletion wsgidav/default_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
|__/|__/___/\_, /_/____/_/ |_|___/
/___/
Default confguration.
Default configuration.
"""
# from wsgidav.mw.debug_filter import WsgiDavDebugFilter
from wsgidav.dir_browser import WsgiDavDirBrowser
Expand Down
2 changes: 1 addition & 1 deletion wsgidav/fs_dav_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def set_last_modified(self, dest_path, time_stamp, *, dry_run):
# FilesystemProvider
# ========================================================================
class FilesystemProvider(DAVProvider):
"""Default implementation of a filessystem DAVProvider.
"""Default implementation of a filesystem DAVProvider.
Args:
root_folder (str)
Expand Down
2 changes: 1 addition & 1 deletion wsgidav/lock_man/lock_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def check_write_permission(self, *, url, depth, token_list, principal):
for lock in lock_list:
_logger.debug(" lock={}".format(lock_string(lock)))
if u != url and lock["depth"] != "infinity":
# We only consider parents with Depth: inifinity
# We only consider parents with Depth: infinity
continue
elif principal == lock["principal"] and lock["token"] in token_list:
# User owns this lock
Expand Down
2 changes: 1 addition & 1 deletion wsgidav/mw/debug_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
Configured like::
debug_methods = ["PROPPATCH", "PROPFIND", "GET", "HEAD", "DELET E",
debug_methods = ["PROPPATCH", "PROPFIND", "GET", "HEAD", "DELETE",
"PUT", "COPY", "MOVE", "LOCK", "UNLOCK",
]
Expand Down
2 changes: 1 addition & 1 deletion wsgidav/prop_man/mongo_property_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
HIDDEN_KEYS = ("_id", "_url", "_title")

# MongiDB doesn't accept '.' in key names, so we have to escape it.
# Use a key that is unlikely to occur in proprty names
# Use a key that is unlikely to occur in property names
DOT_ESCAPE = "^"


Expand Down
4 changes: 2 additions & 2 deletions wsgidav/server/ext_wsgiutils_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ def wsgiWriteData(self, data):
self.end_headers()
self.wsgiSentHeaders = 1
# Send the data
assert type(data) is bytes # If not, Content-Length is propably wrong!
assert type(data) is bytes # If not, Content-Length is probably wrong!
_logger.debug(
"wsgiWriteData: write {} bytes: '{!r}'...".format(
len(data), util.to_str(data[:50])
)
)
if util.is_str(data): # If not, Content-Length is propably wrong!
if util.is_str(data): # If not, Content-Length is probably wrong!
_logger.info("ext_wsgiutils_server: Got unicode data: {!r}".format(data))
# data = util.wsgi_to_bytes(data)
data = util.to_bytes(data)
Expand Down
4 changes: 2 additions & 2 deletions wsgidav/stream_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def read(self, size=0):
# Get next chunk, cumulating requested size as needed
while res == b"" or size < 0 or (size > 0 and len(res) < size):
try:
# Read pending data, blocking if neccessary
# Read pending data, blocking if necessary
# (but handle the case that close() is called while waiting)
res += self.queue.get(True, 0.1)
except queue.Empty:
Expand Down Expand Up @@ -128,7 +128,7 @@ class StreamingFile:
"""A file object wrapped around an iterator / data stream."""

def __init__(self, data_stream):
"""Intialise the object with the data stream."""
"""Initialise the object with the data stream."""
self.data_stream = data_stream
self.buffer = ""

Expand Down
2 changes: 1 addition & 1 deletion wsgidav/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def init_logging(config):
The base logger is filtered by the `verbose` configuration option.
Log entries will have a time stamp and thread id.
**Note:** init_logging() is automatically calle if an application adds
**Note:** init_logging() is automatically called if an application adds
``"logging": { "enable": true }`` to the configuration.
Module loggers
Expand Down

0 comments on commit 056831c

Please sign in to comment.