Skip to content

Commit

Permalink
Add isort to the pre-commit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Apr 18, 2021
1 parent 98f1eff commit d815e06
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ repos:
- --expand-star-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
hooks:
- id: isort
exclude: tests/testdata|astroid/__init__.py
- repo: https://github.com/asottile/pyupgrade
rev: v2.12.0
hooks:
Expand Down
7 changes: 4 additions & 3 deletions astroid/modutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@
:type BUILTIN_MODULES: dict
:var BUILTIN_MODULES: dictionary with builtin module names has key
"""

# We don't want distutils to be a requirement
# pylint: disable=import-error, no-name-in-module,useless-suppression

import importlib.util
import itertools
import os
import platform
import sys

# We don't want distutils to be a requirement
# pylint: disable=import-error, no-name-in-module,useless-suppression
from distutils.errors import DistutilsPlatformError
from distutils.sysconfig import get_python_lib # pylint: disable=import-error

Expand Down
4 changes: 3 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
import sys
from datetime import datetime

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down Expand Up @@ -58,6 +59,7 @@
#
# The short X.Y version.
from astroid.__pkginfo__ import version

# The full version, including alpha/beta/rc tags.
release = version

Expand Down
1 change: 1 addition & 0 deletions requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ black==20.8b1
pyupgrade==2.11.0
black-disable-checker==1.0.0
pylint
isort=5.8.0
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import os
import sys
import warnings

from setuptools import find_packages, setup
from setuptools.command import easy_install # pylint: disable=unused-import
from setuptools.command import install_lib # pylint: disable=unused-import
Expand Down

0 comments on commit d815e06

Please sign in to comment.