Skip to content

Commit

Permalink
minor improvements for multiple pylint_runners (0.5.0 release)
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOdin committed Apr 25, 2017
1 parent 03d1513 commit 463047c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[MASTER]
ignore=build,dist
5 changes: 3 additions & 2 deletions pylint_runner/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

PYTHON_VERSION = '.'.join([str(x) for x in sys.version_info[0:3]])


class Runner(object):
""" A pylint runner that will lint all files recursively from the CWD. """

Expand Down Expand Up @@ -133,9 +134,9 @@ def get_files_from_dir(self, current_dir):
files.append(file_path)
elif (os.path.isdir(dir_file) or os.path.isdir(file_path))\
and dir_file not in self.ignore_folders:
path = dir_file + "/"
path = dir_file + os.path.sep
if current_dir != "" and current_dir != ".":
path = current_dir.rstrip("/") + "/" + path
path = os.path.join(current_dir.rstrip(os.path.sep), path)
files += self.get_files_from_dir(path)
return files

Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from setuptools import setup
from pylint_runner import __author__, __version__

PY3 = sys.version_info > (3,)
MAJOR_VERSION = sys.version_info[0]
MAJOR_MINOR_VERSION = '.'.join([str(x) for x in sys.version_info[0:2]])


def read(*paths):
Expand All @@ -24,7 +25,8 @@ def get_requirements():
return [str(ir.req) for ir in install_reqs]

CONSOLE_SCRIPTS = ['pylint_runner = pylint_runner.main:main',
'pylint_runner{0} = pylint_runner.main:main'.format('3' if PY3 else '2')]
'pylint_runner{0} = pylint_runner.main:main'.format(MAJOR_VERSION),
'pylint_runner{0} = pylint_runner.main:main'.format(MAJOR_MINOR_VERSION)]

setup(
name='pylint_runner',
Expand All @@ -35,7 +37,7 @@ def get_requirements():
author=__author__,
author_email='[email protected]',
description='Run pylint recursively on all py files in current and sub directories',
long_description=open('README.rst').read(), #+ '\n\n' + open('CHANGELOG.rst').read(),
long_description=open('README.rst').read(), # + '\n\n' + open('CHANGELOG.rst').read(),
entry_points={"console_scripts": CONSOLE_SCRIPTS},
install_requires=get_requirements(),
tests_require=['nose'],
Expand Down

0 comments on commit 463047c

Please sign in to comment.