Skip to content

Commit 98ce9fe

Browse files
committed
Add lint step
1 parent e9477dc commit 98ce9fe

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
- name: Install password_validator
4040
run: pip install .
4141

42+
- name: Run lint
43+
run: pylint src
44+
4245
- name: Run tests
4346
run: coverage run -m unittest discover -s tests -v
4447

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ignore=third_party
1313

1414
# Add files or directories matching the regex patterns to the blacklist. The
1515
# regex matches against base names, not paths.
16-
ignore-patterns=object_detection_grpc_client.py,prediction_pb2.py,prediction_pb2_grpc.py
16+
ignore-patterns=object_detection_grpc_client.py,prediction_pb2.py,prediction_pb2_grpc.py,test.*.py
1717

1818
# Pickle collected data for later comparisons.
1919
persistent=no

requirements-dev.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1+
astroid==2.4.1
12
coverage==5.1
3+
isort==4.3.21
4+
lazy-object-proxy==1.4.3
5+
mccabe==0.6.1
6+
pylint==2.5.2
7+
six==1.14.0
8+
toml==0.10.1
9+
typed-ast==1.4.1
10+
wrapt==1.12.1

src/password_validator/password_validator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def validate(self, pwd):
1515
password = str(pwd)
1616
return all(self.__isPasswordValidFor(prop, password) for prop in self.properties)
1717

18-
def __registerProperty(self, func, args=[]):
18+
def __registerProperty(self, func, args=[]): # pylint: disable=dangerous-default-value
1919
self.properties.append({
2020
'method': func,
2121
'positive': self.positive,
@@ -26,7 +26,7 @@ def __isPasswordValidFor(self, prop, password):
2626
return prop['method'](password, prop['positive'], *prop['arguments'])
2727

2828
def __validateNum(self, num):
29-
assert (type(num) == 'int' or num > 0), error['length']
29+
assert (type(num) == 'int' or num > 0), error['length'] # pylint: disable=unidiomatic-typecheck
3030

3131
def has(self, regexp=None):
3232
self.positive = True

0 commit comments

Comments
 (0)