From 6cceb36197ad0f4a3b011dad4e042020b1d2e72a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 3 Nov 2023 15:16:07 -0400 Subject: [PATCH 1/3] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..7373aff --- /dev/null +++ b/.github/workflows/codespell.yml @@ -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 From b2b461323d2db8888b4d77f5797a720c7ee7d27a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 3 Nov 2023 15:16:07 -0400 Subject: [PATCH 2/3] Add rudimentary codespell config --- .codespellrc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..6bcf0b1 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,5 @@ +[codespell] +skip = .git,*.pdf,*.svg,*.css,.codespellrc +check-hidden = true +# ignore-regex = +# ignore-words-list = From ee7ae23253f0115c041f04720e4436fe10edd44b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 3 Nov 2023 15:16:21 -0400 Subject: [PATCH 3/3] [DATALAD RUNCMD] run codespell throughout fixing typo automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- bin/btrfs-search-metadata | 2 +- btrfs/ctree.py | 10 +++++----- btrfs/fs_usage.py | 2 +- btrfs/utils.py | 4 ++-- man/btrfs-balance-least-used.1 | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/btrfs-search-metadata b/bin/btrfs-search-metadata index eb4e785..c6e3d10 100755 --- a/bin/btrfs-search-metadata +++ b/bin/btrfs-search-metadata @@ -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, diff --git a/btrfs/ctree.py b/btrfs/ctree.py index be3dcfb..7af03db 100644 --- a/btrfs/ctree.py +++ b/btrfs/ctree.py @@ -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'): @@ -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 = { @@ -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'): @@ -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): @@ -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 diff --git a/btrfs/fs_usage.py b/btrfs/fs_usage.py index de9a7f1..fa4395b 100644 --- a/btrfs/fs_usage.py +++ b/btrfs/fs_usage.py @@ -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(): diff --git a/btrfs/utils.py b/btrfs/utils.py index e4ec3d7..807a89b 100644 --- a/btrfs/utils.py +++ b/btrfs/utils.py @@ -16,7 +16,7 @@ # along with python-btrfs. If not, see . """ -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. @@ -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:: diff --git a/man/btrfs-balance-least-used.1 b/man/btrfs-balance-least-used.1 index 6e9df9a..9a7584c 100644 --- a/man/btrfs-balance-least-used.1 +++ b/man/btrfs-balance-least-used.1 @@ -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.