From 2723b6c94551492f51c01b87a5ea79129eb9364b Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Wed, 25 Nov 2020 18:58:07 +0000 Subject: [PATCH] :truck: move pylint to pre-commit (#4242) --- .pre-commit-config.yaml | 6 ++++++ .pylintrc | 3 +-- pymc3/backends/base.py | 4 ++-- scripts/lint.sh | 3 --- scripts/test.sh | 4 ---- 5 files changed, 9 insertions(+), 11 deletions(-) delete mode 100755 scripts/lint.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5bda2470df..c6ab661949 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,6 +22,12 @@ repos: rev: 20.8b1 hooks: - id: black +- repo: https://github.com/PyCQA/pylint + rev: pylint-2.6.0 + hooks: + - id: pylint + args: [--rcfile=.pylintrc] + files: ^pymc3/ - repo: local hooks: - id: watermark diff --git a/.pylintrc b/.pylintrc index 7554981da0..952050ed8f 100644 --- a/.pylintrc +++ b/.pylintrc @@ -34,8 +34,7 @@ disable=all # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time. See also the "--disable" option for examples. -enable=import-error, - import-self, +enable=import-self, reimported, wildcard-import, misplaced-future, diff --git a/pymc3/backends/base.py b/pymc3/backends/base.py index 1876826b92..4f3d7f2530 100644 --- a/pymc3/backends/base.py +++ b/pymc3/backends/base.py @@ -18,14 +18,14 @@ """ import itertools as itl import logging -from typing import Dict, List, Optional +from typing import List from abc import ABC import numpy as np import warnings import theano.tensor as tt -from ..model import modelcontext, Model +from ..model import modelcontext from .report import SamplerReport, merge_reports from ..util import get_var_name diff --git a/scripts/lint.sh b/scripts/lint.sh deleted file mode 100755 index 3f3e406f93..0000000000 --- a/scripts/lint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -pylint --rcfile=.pylintrc pymc3 diff --git a/scripts/test.sh b/scripts/test.sh index 353f36c0b9..42b01507d8 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -2,9 +2,5 @@ set -e -if [[ "$RUN_PYLINT" == "true" ]]; then - . ./scripts/lint.sh -fi - _FLOATX=${FLOATX:=float64} THEANO_FLAGS="floatX=${_FLOATX},gcc.cxxflags='-march=core2'" pytest -v --cov=pymc3 --cov-report=xml "$@" --cov-report term