Skip to content

Commit

Permalink
chg: dev: update pre-commit and pylint cfgs, include some whitespace …
Browse files Browse the repository at this point in the history
…cleaup

Signed-off-by: Stephen L Arnold <[email protected]>
  • Loading branch information
sarnold committed Aug 24, 2023
1 parent 56e8159 commit 5d888af
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 56 deletions.
64 changes: 13 additions & 51 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# pre-commit install
# To update the pre-commit hooks run:
# pre-commit install-hooks
exclude: '^(.tox/|.*\.mustache$)'
exclude: '^(.tox/|.*\.mustache$|.*conf.py$)'
repos:
- repo: meta
hooks:
- id: check-useless-excludes
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -20,51 +20,41 @@ repos:
- id: check-yaml
exclude: '(conda/meta.yaml|.pep8speaks.yml)'

# use ffffff (black fork) for single quote normalization
# (otherwise switch to black for double quotes)
- repo: https://github.com/grktsh/ffffff
rev: v2020.8.31
- repo: https://github.com/ambv/black
rev: 23.7.0
hooks:
- id: ffffff
name: "Format code (ffffff)"
- id: black
name: "Format code"
exclude: '(.*tests/.*|.*test.py$|^setup.py$|^test_.*.py$)'
language_version: python3

# - repo: "https://github.com/psf/black"
# rev: "21.9b0"
# hooks:
# - id: "black"
# language_version: python3
# name: "Format code (black)"
# exclude: '(.*tests/.*|.*test.py$|^setup.py$|^test_pystache.py$)'

- repo: "https://github.com/asottile/blacken-docs"
rev: "v1.12.1"
rev: "1.16.0"
hooks:
- id: "blacken-docs"
name: "Format docs (blacken-docs)"
args: ["-l", "64"]
additional_dependencies:
- "black==21.9b0"
- "black==23.1.0"

- repo: https://github.com/PyCQA/doc8
rev: v1.0.0
rev: v1.1.1
hooks:
- id: doc8
args:
- '--max-line-length=90'
- '--ignore=D001'

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: rst-backticks
# exclude: ChangeLog\.rst$
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/myint/autoflake
rev: v1.5.3
rev: v2.2.0
hooks:
- id: autoflake
exclude: '(.*tests/.*|.*test.py$|^setup.py$|^test_.*.py$)'
Expand All @@ -75,47 +65,19 @@ repos:
- --remove-unused-variables

- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 6.1.0
hooks:
- id: flake8
exclude: '(.*tests/.*|.*test.py$|^setup.py$|^test_.*.py$)'
additional_dependencies: ["flake8-bugbear"]

- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
rev: 1.7.5
hooks:
- id: bandit
args: ["-ll", "-x", "pystache/tests"]

- repo: https://github.com/PyCQA/pylint
rev: v2.15.2
hooks:
- id: pylint
exclude: '(.*tests/.*|.*test.py$|^setup.py$|^test_.*.py$)'
args:
[
"-rn",
"-sn",
"--fail-under=8.10",
]

- repo: https://github.com/lovesegfault/beautysh
rev: v6.2.1
hooks:
- id: beautysh

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false

# re-running a pull request: you can trigger a re-run on a pull request by
# commenting pre-commit.ci run (must appear on a line by itself).
# skipping push runs: skip a run by putting [skip ci], [ci skip],
# [skip pre-commit.ci], or [pre-commit.ci skip] in the commit message.
2 changes: 0 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ ignore-paths=
.*tests/,
.*test.py$,

profile=no

jobs=1

suggestion-mode=yes
Expand Down
1 change: 1 addition & 0 deletions pystache/parsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def render(self, engine, context):
Returns: a string of type unicode.
"""

# We avoid use of the ternary operator for Python 2.4 support.
def get_unicode(node):
if type(node) is str:
Expand Down
3 changes: 0 additions & 3 deletions pystache/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def _compile_template_re(delimiters):


class ParsingError(Exception):

pass


Expand Down Expand Up @@ -171,7 +170,6 @@ def render(self, engine, context):


class _SectionNode(object):

# TODO: the template_ and parsed_template_ arguments don't both seem
# to be necessary. Can we remove one of them? For example, if
# callable(data) is True, then the initial parsed_template isn't used.
Expand Down Expand Up @@ -220,7 +218,6 @@ def render(self, engine, context):


class _Parser(object):

_delimiters = None
_template_re = None

Expand Down

0 comments on commit 5d888af

Please sign in to comment.