Skip to content

Move pylint to pre-commit -> faster feedback for devs #4242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if pylint runs in an isolated virtualenv, then it won't be able to import third-party modules. However, invalid imports would already raise an error during the pytest jobs, so this check is redundant and can be removed

import-self,
enable=import-self,
reimported,
wildcard-import,
misplaced-future,
Expand Down
4 changes: 2 additions & 2 deletions pymc3/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions scripts/lint.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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