diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..20dfb84 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# Codespell configuration is within setup.cfg +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/README.md b/README.md index 01914b8..17d0857 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Build Status pypi Downloads -GitHub lastest commit +GitHub latest commit PyPI - Python Version

diff --git a/assets/install_ffmpeg.py b/assets/install_ffmpeg.py index da64f7e..86f5a22 100644 --- a/assets/install_ffmpeg.py +++ b/assets/install_ffmpeg.py @@ -39,7 +39,7 @@ def get_ffmpeg_url(build=None, format=None) -> str: if names[1]: github_version = urllib.request.urlopen( 'https://www.gyan.dev/ffmpeg/builds/release-version').read().decode() - assert github_version, 'failed to retreive latest version from github' + assert github_version, 'failed to retrieve latest version from github' return ( 'https://github.com/GyanD/codexffmpeg/releases/download/' f'{github_version}/ffmpeg-{github_version}-{names[1]}.{ffbuild_format}' diff --git a/setup.cfg b/setup.cfg index 8f47539..28f0e7b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,3 +5,10 @@ license_file = LICENSE [flake8] max-line-length = 127 extend-ignore = E203,W503 + +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.svg +check-hidden = true +# ignore-regex = +# ignore-words-list = diff --git a/videohash2/collagemaker.py b/videohash2/collagemaker.py index 30ea7bf..fc37544 100644 --- a/videohash2/collagemaker.py +++ b/videohash2/collagemaker.py @@ -18,7 +18,7 @@ class MakeCollage: Collage that should be as close to the shape of a square. The images are arranged by timestamp of the frames, their - index in the image_list is based on thier timestamp on the + index in the image_list is based on their timestamp on the video. The image with the index 2 is a frame from the 3rd second and an index 39 is from at the 40th second. The index is one less due to zero-based indexing. @@ -116,7 +116,7 @@ def make(self) -> None: A base image of 'collage_image_width' width and of 'number of rows times scaled frame image height' height is created. The base image has all pixels with RGB value 0,0,0 that is - the base image is pure black. The frame images are now embeded + the base image is pure black. The frame images are now embedded on it. The frame images are scaled to fit the collage base image such that the shape of collage is as close to the shape of a square. @@ -195,7 +195,7 @@ def make(self) -> None: # for the first row the result of floor division is always zero and # the product of 0 with scaled_frame_image_height is also zero, they # y coordinate for the first row is 0. - # For the second row the result of floor division is one and the prodcut + # For the second row the result of floor division is one and the product # with scaled_frame_image_height ensures that the y coordinate is # scaled_frame_image_height below the first row. y = (j // self.images_per_row_in_collage) * scaled_frame_image_height @@ -214,6 +214,6 @@ def make(self) -> None: # therefore the y coordinate stays the same for any given row. j += 1 - # save the base image with all the scaled frame images embeded on it. + # save the base image with all the scaled frame images embedded on it. collage_image.save(self.output_path) collage_image.close() diff --git a/videohash2/framesextractor.py b/videohash2/framesextractor.py index 785ddd2..6c5262e 100644 --- a/videohash2/framesextractor.py +++ b/videohash2/framesextractor.py @@ -32,8 +32,8 @@ def __init__( ffmpeg_path: Optional[str] = None, ) -> None: """ - Raises Exeception if video_path does not exists. - Raises Exeception if output_dir does not exists or if not a directory. + Raises Exception if video_path does not exists. + Raises Exception if output_dir does not exists or if not a directory. Checks the ffmpeg installation and the path; thus ensure that we can use it. diff --git a/videohash2/tilemaker.py b/videohash2/tilemaker.py index 67cdc6c..00752ad 100644 --- a/videohash2/tilemaker.py +++ b/videohash2/tilemaker.py @@ -103,7 +103,7 @@ def save_tiles(tiles, prefix="", directory=os.getcwd(), file_format="png"): tiles (list): List, tuple or set of :class:`Tile` objects to save. prefix (str): Filename prefix of saved tiles. Kwargs: - directory (str): Directory to save tiles. Created if non-existant. + directory (str): Directory to save tiles. Created if non-existent. Returns: Tuple of :class:`Tile` instances. """