From 83bef0f7b2a32f8610a28e9985b22957482337d5 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 16 Apr 2020 13:25:01 +1000 Subject: [PATCH] Correct typos found with codespell (#1467) Correct misspellings and typos located using the codespell tool. Add codespell to pre-commit to avoid further regressions. Fixes #1459 --- .pre-commit-config.yaml | 8 ++++++++ doc/changes.rst | 6 +++--- doc/introduction.rst | 2 +- github/GitRelease.py | 4 ++-- github/MainClass.py | 4 ++-- github/ProjectCard.py | 2 +- github/StatsContributor.py | 2 +- github/__init__.py | 2 +- 8 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 36c7c1ad..588d5aea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,3 +16,11 @@ repos: rev: 3.7.9 hooks: - id: flake8 + - repo: https://github.com/codespell-project/codespell + rev: v1.16.0 + hooks: + - id: codespell + exclude: tests/ + args: + - --ignore-words-list="bloaded,nto,pullrequest,pullrequests,thi,tim,wan,Wan" + - --quiet-level=2 diff --git a/doc/changes.rst b/doc/changes.rst index 4a83f808..ee93f91d 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -555,7 +555,7 @@ Version 1.27.1 (August 12, 2016) * fix python3 compatibility issue for using json/base64 (5b7f0bb) * remove not covered API from readme (9c6f881) * change replay data for update file test case (46895df) -* fix python3 compatability error in test case (00777db) +* fix python3 compatibility error in test case (00777db) * Add repo content create/update/delete testcase (4aaeb9e) * add MAINTAINERS file (a16b55b) * travis: disable email (6347157) @@ -649,7 +649,7 @@ Version 1.25.1 (September 28th, 2014) * `Implement `__ ``Github.get_hook(name)``. Thank you `klmitch `__ for asking * In case bad data is returned by Github API v3, `raise `__ an exception only when the user accesses the faulty attribute, not when constructing the object containing this attribute. Thank you `klmitch `__ for asking * `Fix `__ parameter public/private of ``Repository.edit``. Thank you `daireobroin449 `__ for reporting the issue -* Remove ``Repository.create_download`` and ``NamedUser.create_gist`` as the corrensponding APIs are not documented anymore +* Remove ``Repository.create_download`` and ``NamedUser.create_gist`` as the corresponding APIs are not documented anymore `Version 1.19.0 `__ (September 8th, 2013) (AKFish's edition) ----------------------------------------------------------------------------------------------------------------------------------- @@ -759,7 +759,7 @@ Version 1.12.1 (February 20th, 2013) `Version 1.10.0 `__ (December 25th, 2012) (Christmas 2012 edition) ----------------------------------------------------------------------------------------------------------------------------------------- -* Major improvement: support Python 3! PyGithub is automaticaly tested on `Travis `__ with versions 2.5, 2.6, 2.7, 3.1 and 3.2 of Python +* Major improvement: support Python 3! PyGithub is automatically tested on `Travis `__ with versions 2.5, 2.6, 2.7, 3.1 and 3.2 of Python * Add a shortcut function :meth:`github.MainClass.Github.get_repo` to get a repo directly from its full name. thank you `lwc `__ for the contribution * :meth:`github.MainClass.Github.get_gitignore_templates` and :meth:`github.MainClass.Github.get_gitignore_template` for APIs ``/gitignore/templates`` * Add the optional ``ref`` parameter to :meth:`github.Repository.Repository.get_contents` and :meth:`github.Repository.Repository.get_readme`. Thank you `fixxxeruk `__ for the contribution diff --git a/doc/introduction.rst b/doc/introduction.rst index 2516295e..add78b20 100644 --- a/doc/introduction.rst +++ b/doc/introduction.rst @@ -68,7 +68,7 @@ Projects using PyGithub * `Tratihubis `__ converts Trac tickets to Github issues * https://github.com/fga-gpp-mds/2018.1-Cardinals - website that shows metrics for any public repository (issues, commits, pull requests etc) * https://github.com/CMB/cligh -* https://github.com/natduca/quickopen uses PyGithub to automaticaly create issues +* https://github.com/natduca/quickopen uses PyGithub to automatically create issues * https://gist.github.com/3433798 * https://github.com/zsiciarz/aquila-dsp.org * https://github.com/robcowie/virtualenvwrapper.github diff --git a/github/GitRelease.py b/github/GitRelease.py index 7c3a738b..22f327c3 100644 --- a/github/GitRelease.py +++ b/github/GitRelease.py @@ -215,8 +215,8 @@ class GitRelease(github.GithubObject.CompletableGithubObject): "draft": draft, "prerelease": prerelease, } - # Do not set target_commitish to self.target_commitish when ommited, just don't send it - # alltogether in that case, in order to match the Github API behaviour. Only send it when set. + # Do not set target_commitish to self.target_commitish when omitted, just don't send it + # altogether in that case, in order to match the Github API behaviour. Only send it when set. if target_commitish is not github.GithubObject.NotSet: post_parameters["target_commitish"] = target_commitish headers, data = self._requester.requestJsonAndCheck( diff --git a/github/MainClass.py b/github/MainClass.py index 7aabba3f..6d89a4ff 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -706,7 +706,7 @@ class Github(object): def create_from_raw_data(self, klass, raw_data, headers={}): """ Creates an object from raw_data previously obtained by :attr:`github.GithubObject.GithubObject.raw_data`, - and optionaly headers previously obtained by :attr:`github.GithubObject.GithubObject.raw_headers`. + and optionally headers previously obtained by :attr:`github.GithubObject.GithubObject.raw_headers`. :param klass: the class of the object to create :param raw_data: dict @@ -718,7 +718,7 @@ class Github(object): def dump(self, obj, file, protocol=0): """ Dumps (pickles) a PyGithub object to a file-like object. - Some effort is made to not pickle sensitive informations like the Github credentials used in the :class:`Github` instance. + Some effort is made to not pickle sensitive information like the Github credentials used in the :class:`Github` instance. But NO EFFORT is made to remove sensitive information from the object's attributes. :param obj: the object to pickle diff --git a/github/ProjectCard.py b/github/ProjectCard.py index c22293f4..5335cd31 100644 --- a/github/ProjectCard.py +++ b/github/ProjectCard.py @@ -112,7 +112,7 @@ class ProjectCard(github.GithubObject.CompletableGithubObject): return self._url.value # Note that the content_url for any card will be an "issue" URL, from - # which you can retrieve either an Issue or a PullRequest. Unforunately + # which you can retrieve either an Issue or a PullRequest. Unfortunately # the API doesn't make it clear which you are dealing with. def get_content(self, content_type=github.GithubObject.NotSet): """ diff --git a/github/StatsContributor.py b/github/StatsContributor.py index 0f974a2a..3d800690 100755 --- a/github/StatsContributor.py +++ b/github/StatsContributor.py @@ -37,7 +37,7 @@ class StatsContributor(github.GithubObject.NonCompletableGithubObject): class Week(github.GithubObject.NonCompletableGithubObject): """ - This class represents weekly statistics of a contibutor. + This class represents weekly statistics of a contributor. """ @property diff --git a/github/__init__.py b/github/__init__.py index cc7d1496..80abc201 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -30,7 +30,7 @@ ################################################################################ """ -The primary class you will instanciate is :class:`github.MainClass.Github`. +The primary class you will instantiate is :class:`github.MainClass.Github`. From its ``get_``, ``create_`` methods, you will obtain instances of all Github objects like :class:`github.NamedUser.NamedUser` or :class:`github.Repository.Repository`.