Skip to content

Commit

Permalink
Merge 48ef9bf into a02edc4
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergiy committed Apr 15, 2020
2 parents a02edc4 + 48ef9bf commit 0673d0d
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 7 deletions.
74 changes: 74 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[MASTER]

# Use multiple processes to speed up Pylint.
jobs=1

# Pickle collected data for later comparisons.
persistent=no

# Activate the evaluation score.
score=no

[MESSAGES CONTROL]

# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
confidence=

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
enable=all,
python3
disable=I,
R, # refactoring checks
arguments-differ, # nice to have
bad-continuation, # pep8
bad-whitespace, # pep8, nice to have
comprehension-escape,
import-outside-toplevel,
invalid-name,
missing-class-docstring,
missing-docstring,
missing-function-docstring,
no-self-use,
protected-access,
redefined-outer-name,
too-many-lines,
wrong-import-order,
wrong-import-position


[REPORTS]

# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg})'

# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio).You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=colorized

[TYPECHECK]

# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=requests.structures.LookupDict

# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=requests.packages,
responses,
docker,
http.client,
six.moves
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ env:
OS_VERSION=31
PYTHON_VERSION=3
ENGINE=docker
- ACTION=pylint
OS=fedora
OS_VERSION=29
PYTHON_VERSION=2
ENGINE=docker
- ACTION=pylint
OS=fedora
OS_VERSION=31
PYTHON_VERSION=3
ENGINE=docker
- OS=centos
OS_VERSION=7
PYTHON_VERSION=2
Expand Down
1 change: 1 addition & 0 deletions dockerfile_parse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# This file is generated from template: rel-eng/version_init.template
#

from __future__ import absolute_import
from .parser import DockerfileParser

__version__ = "0.0.16"
2 changes: 1 addition & 1 deletion dockerfile_parse/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from __future__ import unicode_literals, absolute_import

from sys import version_info

Expand Down
2 changes: 1 addition & 1 deletion dockerfile_parse/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
of the BSD license. See the LICENSE file for details.
"""

from __future__ import print_function, unicode_literals
from __future__ import print_function, unicode_literals, absolute_import

import json
import logging
Expand Down
4 changes: 2 additions & 2 deletions dockerfile_parse/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
of the BSD license. See the LICENSE file for details.
"""

from __future__ import print_function, unicode_literals
from __future__ import print_function, unicode_literals, absolute_import

import shlex
from io import StringIO
Expand All @@ -25,7 +25,7 @@ def b2u(string):

def u2b(string):
""" unicode to bytes"""
if ((PY2 and isinstance(string, unicode)) or
if ((PY2 and isinstance(string, unicode)) or
((not PY2) and isinstance(string, str))):
return string.encode('utf-8')
return string
Expand Down
9 changes: 8 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [[ $($ENGINE ps -qa -f name="$CONTAINER_NAME" | wc -l) -eq 0 ]]; then
elif [[ $($ENGINE ps -q -f name="$CONTAINER_NAME" | wc -l) -eq 0 ]]; then
echo found stopped existing container, restarting. volume mounts cannot be updated.
$ENGINE container start "$CONTAINER_NAME"
fi
fi

# Install dependencies
$RUN $PKG install -y $PKG_EXTRA
Expand Down Expand Up @@ -84,6 +84,13 @@ case ${ACTION} in
$RUN $PIP install bandit
TEST_CMD="bandit-baseline -r dockerfile_parse -ll -ii"
;;
"pylint")
# This can run only at fedora because pylint is not packaged in centos
# use distro pylint to not get too new pylint version
$RUN $PKG install -y "${PYTHON}-pylint"
PACKAGES='dockerfile_parse tests'
TEST_CMD="${PYTHON} -m pylint ${PACKAGES}"
;;
*)
echo "Unknown action: ${ACTION}"
exit 2
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
of the BSD license. See the LICENSE file for details.
"""

from __future__ import unicode_literals
from __future__ import unicode_literals, absolute_import

import pytest
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
of the BSD license. See the LICENSE file for details.
"""

from __future__ import unicode_literals
from __future__ import unicode_literals, absolute_import

import inspect
import json
Expand Down

0 comments on commit 0673d0d

Please sign in to comment.