From 56456e11e894af6d490505119250995ec19f7aa0 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 27 Mar 2025 12:05:07 -0400 Subject: [PATCH 1/3] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 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..b026c85 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within .codespellrc +--- +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@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From a1c80cf6373de5e6deb804f4731736efabb86eb5 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 27 Mar 2025 12:05:07 -0400 Subject: [PATCH 2/3] Add rudimentary codespell config --- .codespellrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..1cd4cac --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,.codespellrc +check-hidden = true +# ignore-regex = +# ignore-words-list = From 9770527f66d8a1e6f4ace6f2f7a1faa39419dc45 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 27 Mar 2025 12:05:18 -0400 Subject: [PATCH 3/3] [DATALAD RUNCMD] run codespell throughout fixing few left typos automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- common/panopto_oauth2.py | 4 ++-- folders-cli/panopto_folders.py | 4 ++-- folders-cli/sample.py | 2 +- sessions-cli/panopto_sessions.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/panopto_oauth2.py b/common/panopto_oauth2.py index 80baaa6..1d09b73 100644 --- a/common/panopto_oauth2.py +++ b/common/panopto_oauth2.py @@ -49,12 +49,12 @@ def get_access_token_authorization_code_grant(self): 5. Save the token object, which includes refersh_token, for later refrehsh operation. ''' - # First, try getting a new access token from refesh token. + # First, try getting a new access token from refresh token. access_token = self.__get_refreshed_access_token() if access_token: return access_token - # Then, fallback to the full autorization path. Offline access scope is needed to get refresh token. + # Then, fallback to the full authorization path. Offline access scope is needed to get refresh token. scope = list(DEFAULT_SCOPE) + ['offline_access'] session = OAuth2Session(self.client_id, scope = scope, redirect_uri = REDIRECT_URL) diff --git a/folders-cli/panopto_folders.py b/folders-cli/panopto_folders.py index 6938eb9..b000775 100644 --- a/folders-cli/panopto_folders.py +++ b/folders-cli/panopto_folders.py @@ -25,7 +25,7 @@ def __setup_or_refresh_access_token(self): This method invokes OAuth2 Authorization Code Grant authorization flow. It goes through browser UI for the first time. It refreshes the access token after that and no user interfaction is requetsed. - This is called at the initialization of the class, as well as when 401 (Unaurhotized) is returend. + This is called at the initialization of the class, as well as when 401 (Unaurhotized) is returned. ''' access_token = self.oauth2.get_access_token_authorization_code_grant() self.requests_session.headers.update({'Authorization': 'Bearer ' + access_token}) @@ -38,7 +38,7 @@ def __inspect_response_is_retry_needed(self, response): This method detects 401 (Unauthorized), refresh the access token, and returns as "is retry needed". This method also detects 429 (Too many request) which means API throttling by the server. Wait a sec and return as "is retry needed". - Prodcution code should handle other failure cases and errors as appropriate. + Production code should handle other failure cases and errors as appropriate. ''' if response.status_code // 100 == 2: # Success on 2xx response. diff --git a/folders-cli/sample.py b/folders-cli/sample.py index e7eaa05..6e03c6a 100644 --- a/folders-cli/sample.py +++ b/folders-cli/sample.py @@ -57,7 +57,7 @@ def get_and_display_folder(folders, folder_id): print() print('Folder:') if folder_id == GUID_TOPLEVEL: - print(' Top level folder (no detail informaiton is available)') + print(' Top level folder (no detail information is available)') return None folder = folders.get_folder(folder_id) diff --git a/sessions-cli/panopto_sessions.py b/sessions-cli/panopto_sessions.py index f01f2e0..6da6761 100644 --- a/sessions-cli/panopto_sessions.py +++ b/sessions-cli/panopto_sessions.py @@ -25,7 +25,7 @@ def __setup_or_refresh_access_token(self): This method invokes OAuth2 Authorization Code Grant authorization flow. It goes through browser UI for the first time. It refreshes the access token after that and no user interfaction is requetsed. - This is called at the initialization of the class, as well as when 401 (Unauthorized) is returend. + This is called at the initialization of the class, as well as when 401 (Unauthorized) is returned. ''' access_token = self.oauth2.get_access_token_authorization_code_grant() self.requests_session.headers.update({'Authorization': 'Bearer ' + access_token}) @@ -38,7 +38,7 @@ def __inspect_response_is_retry_needed(self, response): This method detects 401 (Unauthorized), refresh the access token, and returns as "is retry needed". This method also detects 429 (Too many request) which means API throttling by the server. Wait a sec and return as "is retry needed". - Prodcution code should handle other failure cases and errors as appropriate. + Production code should handle other failure cases and errors as appropriate. ''' if response.status_code // 100 == 2: # Success on 2xx response.