From 193248cacbc3f102eb287322b1d60c4fa265e635 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 25 Apr 2023 12:06:33 -0400 Subject: [PATCH 1/5] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 19 +++++++++++++++++++ 1 file changed, 19 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 00000000..5768d7c6 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +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@v1 From 14278c76ac006607e4cce5eef6d3f85687829f26 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 25 Apr 2023 12:06:33 -0400 Subject: [PATCH 2/5] Add rudimentary codespell config --- .codespellrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..9ec0d7c4 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +skip = .git,*.pdf,*.svg +# +# ignore-words-list = From d062a6468e5f6914338ccb456428edb24274bfd8 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 25 Apr 2023 12:08:23 -0400 Subject: [PATCH 3/5] ignores for codespell --- .codespellrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index 9ec0d7c4..0df4d6bd 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,5 @@ [codespell] skip = .git,*.pdf,*.svg -# -# ignore-words-list = +# OptionAll,parms -- variable names used +# bu -- used in bu.ck.et, decided to just skip +ignore-words-list = optionall,parms,bu From b37aa20bd13a8b3482e1be02eeea65fac8fa3fb0 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 25 Apr 2023 12:09:15 -0400 Subject: [PATCH 4/5] Fixed manually some ambigous typos --- ObsoleteChangeLog | 2 +- S3/Config.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ObsoleteChangeLog b/ObsoleteChangeLog index f11fad41..2bb94385 100644 --- a/ObsoleteChangeLog +++ b/ObsoleteChangeLog @@ -57,7 +57,7 @@ No longer keeping ChangeLog up to date, use git log instead! * s3cmd, s3cmd.1, format-manpage.pl: Improved --help text and manpage. * s3cmd: Removed explicit processing of --follow-symlinks - (is cought by the default / main loop). + (is caught by the default / main loop). 2010-12-24 Michal Ludvig diff --git a/S3/Config.py b/S3/Config.py index 1642c4bf..9bbfd7cc 100644 --- a/S3/Config.py +++ b/S3/Config.py @@ -236,7 +236,7 @@ class Config(object): # expected for every send file requests. use_http_expect = False signurl_use_https = False - # Maximum sleep duration for throtte / limitrate. + # Maximum sleep duration for throttle / limitrate. # s3 will timeout if a request/transfer is stuck for more than a short time throttle_max = 100 public_url_use_https = False @@ -491,7 +491,7 @@ def get_key(profile, key, legacy_key, print_warning=True): profile = "default" result = config.get(profile, key) warning( - "Legacy configuratin key '%s' used, please use" + "Legacy configuration key '%s' used, please use" " the standardized config format as described " "here: https://aws.amazon.com/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/", key) From fda267d2a397111d7557a31cec509d498f5ce528 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 25 Apr 2023 12:09:39 -0400 Subject: [PATCH 5/5] [DATALAD RUNCMD] run codespell throughout === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- NEWS | 2 +- ObsoleteChangeLog | 10 +++++----- S3/BaseUtils.py | 2 +- S3/Config.py | 2 +- S3/ConnMan.py | 2 +- S3/ExitCodes.py | 2 +- S3/FileLists.py | 2 +- S3/S3.py | 2 +- S3/Utils.py | 4 ++-- run-tests.py | 4 ++-- s3cmd | 4 ++-- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/NEWS b/NEWS index 85908c1c..d2cdfec1 100644 --- a/NEWS +++ b/NEWS @@ -48,7 +48,7 @@ s3cmd-2.2.0 - 2021-09-27 * Fixed getbucketinfo that was broken when the bucket lifecycle uses the filter element (Liu Lan) * Fixed RestoreRequest XML namespace URL (#1203) (Akete) * Fixed PARTIAL exit code that was not properly set when needed for object_get (#1190) -* Fixed a possible inifinite loop when a file is truncated during hashsum or upload (#1125) (Matthew Krokosz, Florent Viard) +* Fixed a possible infinite loop when a file is truncated during hashsum or upload (#1125) (Matthew Krokosz, Florent Viard) * Fixed report_exception wrong error when LANG env var was not set (#1113) * Fixed wrong wiki url in error messages (Alec Barrett) * Py3: Fixed an AttributeError when using the "files-from" option diff --git a/ObsoleteChangeLog b/ObsoleteChangeLog index 2bb94385..bd766f60 100644 --- a/ObsoleteChangeLog +++ b/ObsoleteChangeLog @@ -192,7 +192,7 @@ No longer keeping ChangeLog up to date, use git log instead! * S3/S3.py: Fix bucket listing for buckets with over 1000 prefixes. (contributed by Timothee Groleau) - * S3/S3.py: Fixed code formating. + * S3/S3.py: Fixed code formatting. 2010-05-21 Michal Ludvig @@ -696,7 +696,7 @@ No longer keeping ChangeLog up to date, use git log instead! 2008-11-24 Michal Ludvig * S3/Utils.py: Common XML parser. - * s3cmd, S3/Exeptions.py: Print info message on Error. + * s3cmd, S3/Exceptions.py: Print info message on Error. 2008-11-21 Michal Ludvig @@ -733,7 +733,7 @@ No longer keeping ChangeLog up to date, use git log instead! * s3cmd: Re-raise the right exception. Merge from 0.9.8.x branch, rel 246: * s3cmd, S3/S3.py, S3/Exceptions.py: Don't abort 'sync' or 'put' on files - that can't be open (e.g. Permision denied). Print a warning and skip over + that can't be open (e.g. Permission denied). Print a warning and skip over instead. Merge from 0.9.8.x branch, rel 245: * S3/S3.py: Escape parameters in strings. Fixes sync to and @@ -754,7 +754,7 @@ No longer keeping ChangeLog up to date, use git log instead! 2008-09-15 Michal Ludvig * s3cmd, S3/S3.py, S3/Utils.py, S3/S3Uri.py, S3/Exceptions.py: - Yet anoter Unicode round. Unicodised all command line arguments + Yet another Unicode round. Unicodised all command line arguments before processing. 2008-09-15 Michal Ludvig @@ -1242,7 +1242,7 @@ No longer keeping ChangeLog up to date, use git log instead! 2007-01-26 Michal Ludvig - * S3/S3fs.py: Added support for stroing/loading inodes. + * S3/S3fs.py: Added support for storing/loading inodes. No data yet however. 2007-01-26 Michal Ludvig diff --git a/S3/BaseUtils.py b/S3/BaseUtils.py index b6b79086..85ade1b1 100644 --- a/S3/BaseUtils.py +++ b/S3/BaseUtils.py @@ -96,7 +96,7 @@ def dateS3toUnix(date): def dateRFC822toPython(date): """ - Convert a string formated like '2020-06-27T15:56:34Z' into a python datetime + Convert a string formatted like '2020-06-27T15:56:34Z' into a python datetime """ return dateutil.parser.parse(date, fuzzy=True) __all__.append("dateRFC822toPython") diff --git a/S3/Config.py b/S3/Config.py index 9bbfd7cc..fcf1fd0b 100644 --- a/S3/Config.py +++ b/S3/Config.py @@ -206,7 +206,7 @@ class Config(object): reduced_redundancy = False storage_class = u"" follow_symlinks = False - # If too big, this value can be overriden by the OS socket timeouts max values. + # If too big, this value can be overridden by the OS socket timeouts max values. # For example, on Linux, a connection attempt will automatically timeout after 120s. socket_timeout = 300 invalidate_on_cf = False diff --git a/S3/ConnMan.py b/S3/ConnMan.py index 2ec0cafa..65b2f7a0 100644 --- a/S3/ConnMan.py +++ b/S3/ConnMan.py @@ -160,7 +160,7 @@ def match_hostname(self): def _https_connection(hostname, port=None): try: context = http_connection._ssl_context() - # Wilcard certificates do not work with DNS-style named buckets. + # Wildcard certificates do not work with DNS-style named buckets. bucket_name, success = getBucketFromHostname(hostname) if success and '.' in bucket_name: # this merely delays running the hostname check until diff --git a/S3/ExitCodes.py b/S3/ExitCodes.py index 1bb58a9b..31405506 100644 --- a/S3/ExitCodes.py +++ b/S3/ExitCodes.py @@ -5,7 +5,7 @@ EX_OK = 0 EX_GENERAL = 1 EX_PARTIAL = 2 # some parts of the command succeeded, while others failed -EX_SERVERMOVED = 10 # 301: Moved permanantly & 307: Moved temp +EX_SERVERMOVED = 10 # 301: Moved permanently & 307: Moved temp EX_SERVERERROR = 11 # 400, 405, 411, 416, 417, 501: Bad request, 504: Gateway Time-out EX_NOTFOUND = 12 # 404: Not found EX_CONFLICT = 13 # 409: Conflict (ex: bucket error) diff --git a/S3/FileLists.py b/S3/FileLists.py index 823b4cea..eeda969f 100644 --- a/S3/FileLists.py +++ b/S3/FileLists.py @@ -410,7 +410,7 @@ def _get_remote_attribs(uri, remote_item): try: md5 = response['s3cmd-attrs']['md5'] remote_item.update({'md5': md5}) - debug(u"retreived md5=%s from headers" % md5) + debug(u"retrieved md5=%s from headers" % md5) except KeyError: pass diff --git a/S3/S3.py b/S3/S3.py index 9bf2e924..e4296ba6 100644 --- a/S3/S3.py +++ b/S3/S3.py @@ -227,7 +227,7 @@ class S3(object): ) operations = BidirMap( - UNDFINED = 0x0000, + UNDEFINED = 0x0000, LIST_ALL_BUCKETS = targets["SERVICE"] | http_methods["GET"], BUCKET_CREATE = targets["BUCKET"] | http_methods["PUT"], BUCKET_LIST = targets["BUCKET"] | http_methods["GET"], diff --git a/S3/Utils.py b/S3/Utils.py index cf6e7482..55fa99f6 100644 --- a/S3/Utils.py +++ b/S3/Utils.py @@ -299,7 +299,7 @@ def getHostnameFromBucket(bucket): try: import pwd def getpwuid_username(uid): - """returns a username from the password databse for the given uid""" + """returns a username from the password database for the given uid""" return unicodise_s(pwd.getpwuid(uid).pw_name) except ImportError: import getpass @@ -310,7 +310,7 @@ def getpwuid_username(uid): try: import grp def getgrgid_grpname(gid): - """returns a groupname from the group databse for the given gid""" + """returns a groupname from the group database for the given gid""" return unicodise_s(grp.getgrgid(gid).gr_name) except ImportError: def getgrgid_grpname(gid): diff --git a/run-tests.py b/run-tests.py index 7ce84a11..d89af921 100755 --- a/run-tests.py +++ b/run-tests.py @@ -110,7 +110,7 @@ def is_exe(fpath): os.system("tar -xf testsuite/checksum.tar -C testsuite") if not os.path.isfile('testsuite/checksum/cksum33.txt'): - print("Something went wrong while unpacking testsuite/checkum.tar") + print("Something went wrong while unpacking testsuite/checksum.tar") sys.exit(1) ## Fix up permissions for permission-denied tests @@ -874,7 +874,7 @@ def pbucket(tail): must_find = [ "Payer: BucketOwner"], skip_if_profile=['minio']) -## ====== Recursive delete maximum exceeed +## ====== Recursive delete maximum exceed test_s3cmd("Recursive delete maximum exceeded", ['del', '--recursive', '--max-delete=1', '--exclude', 'Atomic*', '%s/xyz/etc' % pbucket(1)], must_not_find = [ "delete: '%s/xyz/etc/TypeRa.ttf'" % pbucket(1) ]) diff --git a/s3cmd b/s3cmd index 9d56b1f7..8962ffdc 100755 --- a/s3cmd +++ b/s3cmd @@ -2037,7 +2037,7 @@ def cmd_sync_local2remote(args): if ret == EX_OK: ret = status # uploaded_objects_list reference is passed so it can be filled with - # destination object of succcessful copies so that they can be + # destination object of successful copies so that they can be # invalidated by cf n_copies, saved_bytes, failed_copy_files = remote_copy( s3, copy_pairs, destination_base, uploaded_objects_list, True) @@ -2881,7 +2881,7 @@ def update_acl(s3, uri, seq_label=""): else: acl.grantAnonRead() something_changed = True - elif cfg.acl_public == False: # we explicitely check for False, because it could be None + elif cfg.acl_public == False: # we explicitly check for False, because it could be None if not acl.isAnonRead() and not acl.isAnonWrite(): info(u"%s: already Private, skipping %s" % (uri, seq_label)) else: