diff --git a/lgtm.yml b/lgtm.yml new file mode 100644 index 0000000000..e14c831a5c --- /dev/null +++ b/lgtm.yml @@ -0,0 +1,6 @@ +queries: + - exclude: py/init-calls-subclass + - exclude: py/unexpected-raise-in-special-method + - exclude: py/modification-of-locals + - exclude: py/multiple-calls-to-init + - exclude: py/missing-call-to-init diff --git a/manim/_config/utils.py b/manim/_config/utils.py index bd5af10b09..3dd79ca474 100644 --- a/manim/_config/utils.py +++ b/manim/_config/utils.py @@ -1102,8 +1102,7 @@ def quality(self): for qual in constants.QUALITIES: if all([q[k] == constants.QUALITIES[qual][k] for k in keys]): return qual - else: - return None + return None @quality.setter def quality(self, qual: str) -> None: diff --git a/manim/camera/camera.py b/manim/camera/camera.py index 41df1e2b7b..ceedde7802 100644 --- a/manim/camera/camera.py +++ b/manim/camera/camera.py @@ -187,8 +187,7 @@ def type_or_raise(self, mobject): for _type in self.display_funcs: if isinstance(mobject, _type): return _type - else: - raise TypeError(f"Displaying an object of class {_type} is not supported") + raise TypeError(f"Displaying an object of class {_type} is not supported") def reset_pixel_shape(self, new_height, new_width): """This method resets the height and width diff --git a/manim/camera/mapping_camera.py b/manim/camera/mapping_camera.py index 690639d982..ee23dce3e9 100644 --- a/manim/camera/mapping_camera.py +++ b/manim/camera/mapping_camera.py @@ -33,7 +33,8 @@ def __init__( def points_to_pixel_coords(self, points): return super().points_to_pixel_coords( np.apply_along_axis(self.mapping_func, 1, points), - ) + ) # TODO: There is an error here, but I don't know how to fix it: + # FIXME: Call to method Camera.points_to_pixel_coords with too few arguments; should be no fewer than 3. def capture_mobjects(self, mobjects, **kwargs): mobjects = self.get_mobjects_to_display(mobjects, **kwargs) diff --git a/manim/cli/cfg/group.py b/manim/cli/cfg/group.py index 8e6ceb14bf..c872da941f 100644 --- a/manim/cli/cfg/group.py +++ b/manim/cli/cfg/group.py @@ -200,8 +200,8 @@ def write(level: str = None, openfile: bool = False) -> None: end="", ) temp = input() - else: - default[key] = temp + + default[key] = temp default = replace_keys(default) if category == "logger" else default diff --git a/manim/mobject/changing.py b/manim/mobject/changing.py index 4aad0bebcb..fa0d3c1ded 100644 --- a/manim/mobject/changing.py +++ b/manim/mobject/changing.py @@ -4,7 +4,6 @@ from typing import Callable, Optional -import numpy as np from colour import Color from .._config import config diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py index c949793eb2..f76655362c 100644 --- a/manim/mobject/mobject.py +++ b/manim/mobject/mobject.py @@ -46,12 +46,7 @@ from ..utils.iterables import list_update, remove_list_redundancies from ..utils.paths import straight_path from ..utils.simple_functions import get_parameters -from ..utils.space_ops import ( - angle_between_vectors, - normalize, - rotation_matrix, - rotation_matrix_transpose, -) +from ..utils.space_ops import angle_between_vectors, normalize, rotation_matrix from .opengl_compatibility import ConvertToOpenGL # TODO: Explain array_attrs diff --git a/manim/mobject/opengl_three_dimensions.py b/manim/mobject/opengl_three_dimensions.py index 9c7f7a67cb..dd72878e1a 100644 --- a/manim/mobject/opengl_three_dimensions.py +++ b/manim/mobject/opengl_three_dimensions.py @@ -1,5 +1,3 @@ -import math - import numpy as np from ..constants import * diff --git a/manim/mobject/svg/opengl_tex_mobject.py b/manim/mobject/svg/opengl_tex_mobject.py index f1154d4110..a8e8170ee5 100644 --- a/manim/mobject/svg/opengl_tex_mobject.py +++ b/manim/mobject/svg/opengl_tex_mobject.py @@ -180,7 +180,6 @@ def construct(self): OpenGLVGroup, ) from ...utils.color import BLACK -from ...utils.deprecation import deprecated from ...utils.strings import split_string_list_to_isolate_substrings from ...utils.tex_file_writing import tex_to_svg_file from .style_utils import parse_style diff --git a/manim/mobject/svg/tex_mobject.py b/manim/mobject/svg/tex_mobject.py index 3bce3c0308..3fb2fb4e42 100644 --- a/manim/mobject/svg/tex_mobject.py +++ b/manim/mobject/svg/tex_mobject.py @@ -36,7 +36,6 @@ from ...mobject.types.vectorized_mobject import VectorizedPoint, VGroup from ...utils.color import BLACK, WHITE from ...utils.deprecation import deprecated_params -from ...utils.tex import TexTemplate from ...utils.tex_file_writing import tex_to_svg_file from .style_utils import parse_style diff --git a/manim/plugins/import_plugins.py b/manim/plugins/import_plugins.py index 180b7bb953..0f5d2c5656 100644 --- a/manim/plugins/import_plugins.py +++ b/manim/plugins/import_plugins.py @@ -37,6 +37,6 @@ exec(f"{lst.__name__}=lst") __all__.append(lst.__name__) plugins_requested.remove(plugin.name) -else: - if plugins_requested != []: - logger.warning("Missing Plugins: %s", plugins_requested) + +if plugins_requested != []: + logger.warning("Missing Plugins: %s", plugins_requested) diff --git a/scripts/dev_changelog.py b/scripts/dev_changelog.py index 806fb54077..3b515a5d6d 100755 --- a/scripts/dev_changelog.py +++ b/scripts/dev_changelog.py @@ -48,7 +48,6 @@ import re from collections import defaultdict from pathlib import Path -from posixpath import dirname from textwrap import dedent, indent import click