From 4b028b50804450cba6efb858261e23b5e02f6eb8 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Mon, 31 Jul 2023 23:45:03 +0800 Subject: [PATCH] Fix typos (#440) Found via `codespell -S ./tests/fixtures -L chage,respons,astroid,unx,ist,technik,ans,buildd` --- docs/parsers/ver.md | 2 +- jc/parsers/crontab.py | 2 +- jc/parsers/crontab_u.py | 2 +- jc/parsers/mount.py | 2 +- jc/parsers/route.py | 2 +- jc/parsers/route_windows.py | 6 +++--- jc/parsers/ver.py | 2 +- tests/test_mdadm.py | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/parsers/ver.md b/docs/parsers/ver.md index 8bdee50e..0759c2aa 100644 --- a/docs/parsers/ver.md +++ b/docs/parsers/ver.md @@ -7,7 +7,7 @@ jc - JSON Convert Version string output parser Best-effort attempt to parse various styles of version numbers. This parser is based off of the version parser included in the CPython distutils -libary. +library. If the version string conforms to some de facto-standard versioning rules followed by many developers a `strict` key will be present in the output diff --git a/jc/parsers/crontab.py b/jc/parsers/crontab.py index dc0a0168..3fae53b8 100644 --- a/jc/parsers/crontab.py +++ b/jc/parsers/crontab.py @@ -198,7 +198,7 @@ def _process(proc_data): Dictionary. Structured data to conform to the schema. """ - # put itmes in lists + # put items in lists try: for entry in proc_data['schedule']: entry['minute'] = entry['minute'].split(',') diff --git a/jc/parsers/crontab_u.py b/jc/parsers/crontab_u.py index 76fd1ac6..345a8e91 100644 --- a/jc/parsers/crontab_u.py +++ b/jc/parsers/crontab_u.py @@ -194,7 +194,7 @@ def _process(proc_data): Dictionary. Structured data to conform to the schema. """ - # put itmes in lists + # put items in lists try: for entry in proc_data['schedule']: entry['minute'] = entry['minute'].split(',') diff --git a/jc/parsers/mount.py b/jc/parsers/mount.py index 301e35e4..ef8a49dc 100644 --- a/jc/parsers/mount.py +++ b/jc/parsers/mount.py @@ -160,7 +160,7 @@ def _aix_parse(data): # AIX mount entries have the remote node as the zeroth element. If the # mount is local, the zeroth element is the filesystem instead. We can - # detect this by the lenth of the list. For local mounts, length is 7, + # detect this by the length of the list. For local mounts, length is 7, # and for remote mounts, the length is 8. In the remote case, pop off # the zeroth element. Then parsed_line has a consistent format. if len(parsed_line) == 8: diff --git a/jc/parsers/route.py b/jc/parsers/route.py index b9590ee6..d6ae5a42 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -214,7 +214,7 @@ def parse(data, raw=False, quiet=False): if jc.utils.has_data(data): import jc.parsers.route_windows - if cleandata[0] in jc.parsers.route_windows.SEPERATORS: + if cleandata[0] in jc.parsers.route_windows.SEPARATORS: raw_output = jc.parsers.route_windows.parse(cleandata) else: cleandata.pop(0) # Removing "Kernel IP routing table". diff --git a/jc/parsers/route_windows.py b/jc/parsers/route_windows.py index 19f7c142..46a8cbf7 100644 --- a/jc/parsers/route_windows.py +++ b/jc/parsers/route_windows.py @@ -6,7 +6,7 @@ import re from typing import List -SEPERATORS = ( +SEPARATORS = ( "===========================================================================", " None" ) @@ -24,7 +24,7 @@ ROUTE_TYPES = ("Active Routes:", "Persistent Routes:") def get_lines_until_seperator(iterator): lines = [] for line in iterator: - if line in SEPERATORS: + if line in SEPARATORS: break lines.append(line) return lines @@ -86,7 +86,7 @@ def parse(cleandata: List[str]): interfaces = [] for interface_line in data_iterator: interface_line = interface_line.strip() - if interface_line in SEPERATORS: + if interface_line in SEPARATORS: break interface_match = INTERFACE_REGEX.search(interface_line) diff --git a/jc/parsers/ver.py b/jc/parsers/ver.py index 43126804..b4e5fd61 100644 --- a/jc/parsers/ver.py +++ b/jc/parsers/ver.py @@ -2,7 +2,7 @@ Best-effort attempt to parse various styles of version numbers. This parser is based off of the version parser included in the CPython distutils -libary. +library. If the version string conforms to some de facto-standard versioning rules followed by many developers a `strict` key will be present in the output diff --git a/tests/test_mdadm.py b/tests/test_mdadm.py index f0d048bc..f2a03ef7 100644 --- a/tests/test_mdadm.py +++ b/tests/test_mdadm.py @@ -173,7 +173,7 @@ class MyTests(unittest.TestCase): mdadm_examine_json = json.loads(f.read()) with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mdadm-query-detail.json'), 'r', encoding='utf-8') as f: - mdadm_query_detial_json = json.loads(f.read()) + mdadm_query_detail_json = json.loads(f.read()) with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mdadm-query-raid0-ok.json'), 'r', encoding='utf-8') as f: mdadm_query_raid0_ok_json = json.loads(f.read()) @@ -360,7 +360,7 @@ class MyTests(unittest.TestCase): """ Test 'mdadm --query --detail' """ - self.assertEqual(jc.parsers.mdadm.parse(self.mdadm_query_detail, quiet=True), self.mdadm_query_detial_json) + self.assertEqual(jc.parsers.mdadm.parse(self.mdadm_query_detail, quiet=True), self.mdadm_query_detail_json) def test_mdadm_query_raid0_ok(self):