Skip to content

Commit

Permalink
Adding spell checker as a pre-commit hook (#1544)
Browse files Browse the repository at this point in the history
* adding codespell precommit hook

* adding codespell config file

* fixing typos

* tweaking variable names to please codespell
  • Loading branch information
Skaft authored May 21, 2021
1 parent fbee8ad commit 60a7757
Show file tree
Hide file tree
Showing 42 changed files with 105 additions and 97 deletions.
1 change: 1 addition & 0 deletions .codespell_ignorelines
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<path id="nd" d="m 464.7,68.6 -1.1,2.8 .8,1.4 -.3,5.1 -.5,1.1 2.7,9.1 1.3,2.5 .7,14 1,2.7 -.4,5.8 2.9,7.4 .3,5.8 -.1,2.1 -29.5,-.4 -46,-2.1 -39.2,-2.9 5.2,-66.7 44.5,3.4 55.3,1.6 z">
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
exclude-file=.codespell_ignorelines
check-hidden=True
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[flake8]
max-line-length = 88
#Black Compatability
#Black Compatibility
extend-ignore = E203, E266,
#Style Changes

#Temp
F841, B007,
#I belive these are unfixable
#I believe these are unfixable
B006
#Code Changes - Remove later -remove from .pre-commit-config.yaml

Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ repos:
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
hooks:
- id: codespell
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ confidence=
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# disable everything first and then re-enable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
Expand Down
2 changes: 1 addition & 1 deletion docs/source/changelog/0.5.0-changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ Code quality improvements and similar refactors
- Added `is_static_wait` attributes to Wait. (<=> if wait is a frozen frame).
- Renamed and moved `scene.add_static_frame` to `renderer.freeze_current_frame`.
- Now when calling play without animation, it raises `ValueError` instead of just a warning.
- Fixed :pr:`874` by modfying `renderer.update_skipping_status`
- Fixed :pr:`874` by modifying `renderer.update_skipping_status`
- `renderer` starts the animation with `scene.begin_animations` (`scene.compile_animation_data` used to do this)
- The run time and the time progression generation is now done in `scene.play_internal` although it'd make more sense that renderer processes it later.
- Added a bunch of cool tests thanks to mocks, and thanks to the new syntax `scene.render`
Expand Down
6 changes: 3 additions & 3 deletions docs/source/changelog/0.6.0-changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Enhancements
* `#1364 <https://github.com/ManimCommunity/manim/pull/1364>`__: Added :meth:`~.Mobject.match_points`
- Added :func:`~.Mobject.match_points`, which transforms the points, positions and submobjects of a Mobject to match that of the other while keeping style unchanged.

* `#1363 <https://github.com/ManimCommunity/manim/pull/1363>`__: Change of TeX complier and output file format
* `#1363 <https://github.com/ManimCommunity/manim/pull/1363>`__: Change of TeX compiler and output file format


* `#1359 <https://github.com/ManimCommunity/manim/pull/1359>`__: Make FILE a required argument
Expand Down Expand Up @@ -309,7 +309,7 @@ Documentation-related changes
* `#1338 <https://github.com/ManimCommunity/manim/pull/1338>`__: Added documentation guidelines for type hints


* `#1342 <https://github.com/ManimCommunity/manim/pull/1342>`__: Mutliple VauleTracker example for docs
* `#1342 <https://github.com/ManimCommunity/manim/pull/1342>`__: Multiple ValueTracker example for docs


* `#1210 <https://github.com/ManimCommunity/manim/pull/1210>`__: Added tutorial chapter on coordinates of an mobject
Expand All @@ -333,7 +333,7 @@ Documentation-related changes
* `#1300 <https://github.com/ManimCommunity/manim/pull/1300>`__: Added typehints for :class:`~.ValueTracker`


* `#1301 <https://github.com/ManimCommunity/manim/pull/1301>`__: Added futher docstrings and typehints to :class:`~.Mobject`
* `#1301 <https://github.com/ManimCommunity/manim/pull/1301>`__: Added further docstrings and typehints to :class:`~.Mobject`


* `#1298 <https://github.com/ManimCommunity/manim/pull/1298>`__: Add double backquotes for rst code samples (value_tracker.py)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Here is the syntax:

* ``.. manim:: [SCENE_NAME]`` has no indentation and ``SCENE_NAME`` refers to the name of the class below.

* The flags are followed in the next line (no blank line here!), with the indention level of one tab.
* The flags are followed in the next line (no blank line here!), with the indentation level of one tab.

All possible flags can be found at :mod:`~.manim_directive`.

Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ Animations
theta_tracker.get_value() * DEGREES, about_point=rotation_center
)
a = Angle(line1, line_moving, radius=0.5, other_angle=False)
te = MathTex(r"\theta").move_to(
tex = MathTex(r"\theta").move_to(
Angle(
line1, line_moving, radius=0.5 + 3 * SMALL_BUFF, other_angle=False
).point_from_proportion(0.5)
)

self.add(line1, line_moving, a, te)
self.add(line1, line_moving, a, tex)
self.wait()

line_moving.add_updater(
Expand All @@ -162,7 +162,7 @@ Animations
a.add_updater(
lambda x: x.become(Angle(line1, line_moving, radius=0.5, other_angle=False))
)
te.add_updater(
tex.add_updater(
lambda x: x.move_to(
Angle(
line1, line_moving, radius=0.5 + 3 * SMALL_BUFF, other_angle=False
Expand All @@ -172,7 +172,7 @@ Animations

self.play(theta_tracker.animate.set_value(40))
self.play(theta_tracker.animate.increment_value(140))
self.play(te.animate.set_color(RED), run_time=0.5)
self.play(tex.animate.set_color(RED), run_time=0.5)
self.play(theta_tracker.animate.set_value(350))

.. tip::
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Enabling plugins through ``manim.cfg``
[CLI]
plugins = manim_rubikscube
For specifing multiple plugins, command separated values must be used.
For specifying multiple plugins, command separated values must be used.

.. code-block:: ini
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ can help in identifying what version of manim files are written for:
+--------------+-------------------------+----------------------------+-----------------------------------------+

If you are a beginner, you should only attempt to run files written for
your version. Files written for a different version of manim wil
your version. Files written for a different version of manim will
generally not work without some modification.

Identifying the version you are running
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation/win.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Windows
=======

There are two simple ways to download manim's depedencies, using the popular package
There are two simple ways to download manim's dependencies, using the popular package
managers `Scoop <https://scoop.sh>`_ and `Chocolatey <https://chocolatey.org/install>`_

.. _scoop:
Expand Down
2 changes: 1 addition & 1 deletion manim/_config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ disable_caching = False
# --tex_template
tex_template =

# specify the plugins as comma seperated values
# specify the plugins as comma separated values
# manim will load that plugin if it specified here.
plugins =

Expand Down
2 changes: 1 addition & 1 deletion manim/_config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class ManimConfig(MutableMapping):
manim scene.py -c BLUE
will set the background color to BLUE, regardless of the conents of
will set the background color to BLUE, regardless of the contents of
``manim.cfg``.
Finally, any programmatic changes made within the scene script itself will
Expand Down
4 changes: 2 additions & 2 deletions manim/animation/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def interpolate_submobject(
self,
submobject: Mobject,
starting_submobject: Mobject,
# target_copy: Mobject, #Todo: fix - signature of interpolate_submobject differes in Transform().
# target_copy: Mobject, #Todo: fix - signature of interpolate_submobject differs in Transform().
alpha: float,
) -> "Animation":
# Typically implemented by subclass
Expand Down Expand Up @@ -386,7 +386,7 @@ def get_rate_func(
Returns
-------
Callable[[float], float]
The rate fucntion of the animation.
The rate function of the animation.
"""
return self.rate_func

Expand Down
22 changes: 11 additions & 11 deletions manim/animation/fading.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ class _Fade(Transform):
mobjects
The mobjects to be faded.
shift
The vector by which the mobject shifts while beeing faded.
The vector by which the mobject shifts while being faded.
target_position
The position to/from which the mobject moves while beeing faded in. In case
The position to/from which the mobject moves while being faded in. In case
another mobject is given as target position, its center is used.
scale
The factor by which the mobject is scaled initially before beeing rescaling to
its original size while beeing faded in.
The factor by which the mobject is scaled initially before being rescaling to
its original size while being faded in.
"""

Expand Down Expand Up @@ -113,13 +113,13 @@ class FadeIn(_Fade):
mobjects
The mobjects to be faded in.
shift
The vector by which the mobject shifts while beeing faded in.
The vector by which the mobject shifts while being faded in.
target_position
The position from which the mobject starts while beeing faded in. In case
The position from which the mobject starts while being faded in. In case
another mobject is given as target position, its center is used.
scale
The factor by which the mobject is scaled initially before beeing rescaling to
its original size while beeing faded in.
The factor by which the mobject is scaled initially before being rescaling to
its original size while being faded in.
Examples
--------
Expand Down Expand Up @@ -158,12 +158,12 @@ class FadeOut(_Fade):
mobjects
The mobjects to be faded out.
shift
The vector by which the mobject shifts while beeing faded out.
The vector by which the mobject shifts while being faded out.
target_position
The position to which the mobject moves while beeing faded out. In case another
The position to which the mobject moves while being faded out. In case another
mobject is given as target position, its center is used.
scale
The factor by which the mobject is scaled while beeing faded out.
The factor by which the mobject is scaled while being faded out.
Examples
--------
Expand Down
12 changes: 6 additions & 6 deletions manim/animation/indication.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def create_starting_mobject(self) -> "Dot":


class Indicate(Transform):
"""Indicate a Mobject by temporaly resizing and recoloring it.
"""Indicate a Mobject by temporarily resizing and recoloring it.
Parameters
----------
Expand Down Expand Up @@ -519,7 +519,7 @@ def wave(t):
# either rises to one or goes down to zero. Consecutive ripples will have
# their amplitudes in oppising directions (first ripple from 0 to 1 to 0,
# second from 0 to -1 to 0 and so on). This is how two ripples would be
# devided into phases:
# divided into phases:

# ####|#### | |
# ## | ## | |
Expand All @@ -529,8 +529,8 @@ def wave(t):
# | | ## | ##
# | | ####|####

# However, this looks weired in the middle between two ripples. Therefor the
# middle phases do acutally use only one appropriately scaled version of the
# However, this looks weird in the middle between two ripples. Therefore the
# middle phases do actually use only one appropriately scaled version of the
# rate like this:

# 1 / 4 Time | 2 / 4 Time | 1 / 4 Time
Expand All @@ -555,7 +555,7 @@ def wave(t):
# First rising ripple
return wave_func(t * phases)
elif phase == phases - 1:
# last ripple. Rising or falling depening on the number of ripples
# last ripple. Rising or falling depending on the number of ripples
# The (ripples % 2)-term is used to make this destinction.
t -= phase / phases # Time relative to the phase
return (1 - wave_func(t * phases)) * (2 * (ripples % 2) - 1)
Expand Down Expand Up @@ -588,7 +588,7 @@ class Wiggle(Animation):
mobject : Mobject
The mobject to wiggle.
scale_value
The factor by which the mobject will be temporarilly scaled.
The factor by which the mobject will be temporarily scaled.
rotation_angle
The wiggle angle.
n_wiggles
Expand Down
4 changes: 2 additions & 2 deletions manim/camera/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ def apply_stroke(self, ctx, vmobject, background=False):
return self

def get_stroke_rgbas(self, vmobject, background=False):
"""Get's the RGBA array for the stroke of the passed
"""Gets the RGBA array for the stroke of the passed
VMobject.
Parameters
Expand Down Expand Up @@ -1145,7 +1145,7 @@ def get_coords_of_all_pixels(self):
return centered_space_coords


# NOTE: The methods of the following class have not been mentioned outside of their definitons.
# NOTE: The methods of the following class have not been mentioned outside of their definitions.
# Their DocStrings are not as detailed as preferred.
class BackgroundColoredVMobjectDisplayer:
def __init__(self, camera):
Expand Down
2 changes: 1 addition & 1 deletion manim/cli/cfg/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def write(level: str = None, openfile: bool = False) -> None:

for key in default:
# All the cfg entries for logger need to be validated as styles,
# as long as they arent setting the log width or height etc
# as long as they aren't setting the log width or height etc
if category == "logger" and key not in RICH_NON_STYLE_ENTRIES:
desc = "style"
style = default[key]
Expand Down
2 changes: 1 addition & 1 deletion manim/cli/new/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def scene(**args):
FILE is the name of file in which the SCENE will be inserted.
"""
if not Path("main.py").exists():
raise FileNotFoundError(f"{Path('main.py')} : Not a valid project direcotory.")
raise FileNotFoundError(f"{Path('main.py')} : Not a valid project directory.")

template_name = click.prompt(
"template",
Expand Down
2 changes: 1 addition & 1 deletion manim/mobject/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2175,7 +2175,7 @@ class Triangle(RegularPolygon):
Parameters
----------
kwargs : Any
Additonal arguments to be passed to :class:`RegularPolygon`
Additional arguments to be passed to :class:`RegularPolygon`
Examples
--------
Expand Down
4 changes: 2 additions & 2 deletions manim/mobject/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def __init__(
h_buff : :class:`float`, optional
horizontal buffer, by default 1.3
bracket_h_buff : :class:`float`, optional
bracket horizonal buffer, by default MED_SMALL_BUFF
bracket horizontal buffer, by default MED_SMALL_BUFF
bracket_v_buff : :class:`float`, optional
bracket veritical buffer, by default MED_SMALL_BUFF
bracket vertical buffer, by default MED_SMALL_BUFF
add_background_rectangles_to_entries : :class:`bool`, optional
`True` if should add backgraound rectangles to entries, by default False
include_background_rectangle : :class:`bool`, optional
Expand Down
2 changes: 1 addition & 1 deletion manim/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ def add_updater(
index
The index at which the new updater should be added in ``self.updaters``. In case ``index`` is ``None`` the updater will be added at the end.
call_updater
Wheather or not to call the updater initially. If ``True``, the updater will be called using ``dt=0``.
Whether or not to call the updater initially. If ``True``, the updater will be called using ``dt=0``.
Returns
-------
Expand Down
6 changes: 3 additions & 3 deletions manim/mobject/opengl_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ def point_from_proportion(self, alpha):
return interpolate(points[i], points[i + 1], subalpha)

def pfp(self, alpha):
"""Abbreviation fo point_from_proportion"""
"""Abbreviation for point_from_proportion"""
return self.point_from_proportion(alpha)

def get_pieces(self, n_pieces):
Expand Down Expand Up @@ -1365,7 +1365,7 @@ def pointwise_become_partial(self, mobject, a, b):

def become(self, mobject):
"""
Edit all data and submobjects to be idential
Edit all data and submobjects to be identical
to another mobject
"""
self.align_family(mobject)
Expand Down Expand Up @@ -1522,7 +1522,7 @@ def get_shader_wrapper_list(self):
return result

def check_data_alignment(self, array, data_key):
# Makes sure that self.data[key] can be brodcast into
# Makes sure that self.data[key] can be broadcast into
# the given array, meaning its length has to be either 1
# or the length of the array
d_len = len(self.data[data_key])
Expand Down
4 changes: 2 additions & 2 deletions manim/mobject/polyhedra.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class Polyhedron(VGroup):
"""An abstract polyhedra class.
In this implementation, polyhedra are defined with a list of vertex coordinates in space, and a list
of faces. This implementataion mirrors that of a standard polyhedral data format (OFF, object file format).
of faces. This implementation mirrors that of a standard polyhedral data format (OFF, object file format).
Parameters
----------
vertex_coords
A list of coordinates of the corresponding vertices in the polyhedron. Each coordinate will correspond to
a vertex. The vertices are indexed with the usual indexing of Python.
faces_list
A list of faces. Each face is a sublist containing the indicies of the vertices that form the corners of that face.
A list of faces. Each face is a sublist containing the indices of the vertices that form the corners of that face.
faces_config
Configuration for the polygons representing the faces of the polyhedron.
graph_config
Expand Down
Loading

0 comments on commit 60a7757

Please sign in to comment.