Skip to content

Add codespell support (workflow, config) and fix some typos #44

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = .git,*.pdf,*.svg,*.css,.codespellrc
check-hidden = true
# ignore-regex =
# ignore-words-list =
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 bin/btrfs-search-metadata
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ presets = {
),
'devices': (get_devices, args_default, "Display devices"),
'orphans': (get_orphans, args_default, "Orphan items from the Root Tree"),
'dump': (dump, args_dump, "Dump aribitrary ranges of metadata items"),
'dump': (dump, args_dump, "Dump arbitrary ranges of metadata items"),
'block_group_contents': (
get_block_group_contents,
args_block_group_contents,
Expand Down
10 changes: 5 additions & 5 deletions btrfs/ctree.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def _key_str_objectid(objectid_str, _type):
if match is not None:
return _qgroup_objectid(**match.groupdict())
else:
raise ValueError("Unparseable key objectid {} for qgroup type {}".format(
raise ValueError("Unparsable key objectid {} for qgroup type {}".format(
objectid_str, _key_type_str(_type)))
# is it some UUID hex string?
if objectid_str.startswith('0x'):
Expand All @@ -415,7 +415,7 @@ def _key_str_objectid(objectid_str, _type):
except Exception:
pass
# otherwise, we don't know
raise ValueError("Unparseable key objectid {}".format(objectid_str))
raise ValueError("Unparsable key objectid {}".format(objectid_str))


_key_type_str_map = {
Expand Down Expand Up @@ -508,7 +508,7 @@ def _key_str_offset(offset_str, _type):
if match is not None:
return _qgroup_objectid(**{k: int(v) for k, v in match.groupdict().items()})
else:
raise ValueError("Unparseable key offset {} for qgroup type {}".format(
raise ValueError("Unparsable key offset {} for qgroup type {}".format(
offset_str, _key_type_str(_type)))
# is it some UUID hex string?
if offset_str.startswith('0x'):
Expand All @@ -517,7 +517,7 @@ def _key_str_offset(offset_str, _type):
except Exception:
pass
# otherwise, we don't know
raise ValueError("Unparseable key offset {}".format(offset_str))
raise ValueError("Unparsable key offset {}".format(offset_str))


class ItemNotFoundError(IndexError):
Expand Down Expand Up @@ -576,7 +576,7 @@ class Key(object):
'(-1 255 -1)'

The `-1` value in the string representation is just a convenience way to
write the maximum allowed number. The actual value for a 64 bit numer is
write the maximum allowed number. The actual value for a 64 bit number is
still 18446744073709551615, and for 8 bit that's 255 of course.

For example, when setting up a minimum and maximum key for a metadata
Expand Down
2 changes: 1 addition & 1 deletion btrfs/fs_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def __init__(self, fs, data_metadata_ratio=None,
# For convenience reasons, we provide a few more derived numbers...
#
# If the soft unallocatable amount of bytes is higher than the hard
# amount, we can reclaim space by balancing the filesytsem.
# amount, we can reclaim space by balancing the filesystem.
self.unallocatable_reclaimable = \
max(self.unallocatable_soft - self.unallocatable_hard, 0)
for dev_usage in self.dev_usage.values():
Expand Down
4 changes: 2 additions & 2 deletions btrfs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with python-btrfs. If not, see <http://www.gnu.org/licenses/>.

"""
This module contains miscellanious collection of things, like the
This module contains miscellaneous collection of things, like the
:func:`pretty_print` function which provides a quick readable textual dump of
most of the object types in this library. Besides that, some functions to
pretty print and parse size strings and some other stuff.
Expand Down Expand Up @@ -409,7 +409,7 @@ def embedded_text_for_str(text):
:rtype: str

This function is not intended to be used for anything else than a
convienient way of displaying filenames and xattr keys and values in the
convenient way of displaying filenames and xattr keys and values in the
pretty printer.

Example::
Expand Down
2 changes: 1 addition & 1 deletion man/btrfs-balance-least-used.1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ already existing block groups.

What btrfs balance effectively does is just taking the data and feeding it back
to the allocator of the filesystem as new writes, blacklisting their current
location. Implementing user space balance filters can result in a higly
location. Implementing user space balance filters can result in a highly
optimized workflow to reclaim physical space, or to minimize the amount of data
that has to be rewritten to rebalance complex filesystems with multiple
devices.
Expand Down