Skip to content

Commit

Permalink
chore: stupid mypy/pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Dec 31, 2021
1 parent 63dcbe0 commit 33fb2e0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ output-format=colorized
# --disable=W"
# Configurations for the black formatter
disable=bad-continuation,bad-whitespace,
fixme,cyclic-import
fixme,cyclic-import,line-too-long

[BASIC]

Expand Down
5 changes: 3 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ Contents of `resources/python/mypy.toml <https://github.com/andreoliwa/nitpick/b
# Lint-style cleanliness for typing
warn_redundant_casts = true
warn_unused_ignores = true
# False positives when running on local machine... it works on pre-commit.ci ¯\_(ツ)_/¯
warn_unused_ignores = false
[[".pre-commit-config.yaml".repos]]
yaml = """
Expand Down Expand Up @@ -368,7 +369,7 @@ Contents of `resources/python/pylint.toml <https://github.com/andreoliwa/nitpick
# comma_separated_values = ["MESSAGES CONTROL.disable"]
# This syntax will be deprecated anyway, so I won't make it work now
# Configurations for the black formatter
#disable = "bad-continuation,bad-whitespace,fixme,cyclic-import"
#disable = "bad-continuation,bad-whitespace,fixme,cyclic-import,line-too-long"
[".pylintrc".BASIC]
# List of builtins function names that should not be used, separated by a comma
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ follow_imports = normal
strict_optional = True
warn_no_return = True
warn_redundant_casts = True
warn_unused_ignores = True
# False positives when running on local machine... it works on pre-commit.ci ¯\_(ツ)_/¯
warn_unused_ignores = false
exclude =
src/nitpick/compat.py

Expand Down
4 changes: 2 additions & 2 deletions src/nitpick/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def compare_with_dictdiffer(
return comparison


class InlineTableTomlDecoder(toml.TomlDecoder):
class InlineTableTomlDecoder(toml.TomlDecoder): # type: ignore[name-defined]
"""A hacky decoder to work around some bug (or unfinished work) in the Python TOML package.
https://github.com/uiri/toml/issues/362.
Expand All @@ -231,7 +231,7 @@ def load(self) -> bool:
# TODO: I tried to replace toml by tomlkit, but lots of tests break.
# The conversion to OrderedDict is not being done recursively (although I'm not sure this is a problem).
# self._object = OrderedDict(tomlkit.loads(self._string))
self._object = toml.loads(self._string, decoder=InlineTableTomlDecoder(OrderedDict))
self._object = toml.loads(self._string, decoder=InlineTableTomlDecoder(OrderedDict)) # type: ignore[call-arg]
if self._object is not None:
if isinstance(self._object, BaseFormat):
self._reformatted = self._object.reformatted
Expand Down
3 changes: 2 additions & 1 deletion src/nitpick/resources/python/mypy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ warn_no_return = true

# Lint-style cleanliness for typing
warn_redundant_casts = true
warn_unused_ignores = true
# False positives when running on local machine... it works on pre-commit.ci ¯\_(ツ)_/¯
warn_unused_ignores = false

[[".pre-commit-config.yaml".repos]]
yaml = """
Expand Down
2 changes: 1 addition & 1 deletion src/nitpick/resources/python/pylint.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ output-format = "colorized"
# comma_separated_values = ["MESSAGES CONTROL.disable"]
# This syntax will be deprecated anyway, so I won't make it work now
# Configurations for the black formatter
#disable = "bad-continuation,bad-whitespace,fixme,cyclic-import"
#disable = "bad-continuation,bad-whitespace,fixme,cyclic-import,line-too-long"

[".pylintrc".BASIC]
# List of builtins function names that should not be used, separated by a comma
Expand Down

0 comments on commit 33fb2e0

Please sign in to comment.