Skip to content

Commit

Permalink
Add pylint check
Browse files Browse the repository at this point in the history
Fix pylint issues
  • Loading branch information
paveldat committed Sep 11, 2023
1 parent 5379c28 commit a076bbb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/deploy-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt install pycodestyle
python -m pip install --upgrade pip
sudo apt install pycodestyle pylint
pip install -r py-requirements.txt
- name: Analysing the code with pycodestyle
run: |
pycodestyle src/**/*.py
- name: Analysing the code with pylint
run: |
pylint src/**/*.py
deploy:
runs-on: ubuntu-latest
needs: test
Expand Down
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[MESSAGES CONTROL]
disable = C0413, W1203, W0703, R1710, R0903, R1732,
R0201, W1508, R0801
10 changes: 5 additions & 5 deletions py-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pathlib
dnspython
dnspython >= 2.2.1
requests
python-nmap
python-nmap >= 0.7.1
build
folium
opencage
phonenumbers
folium >= 0.14.0
opencage >= 2.1.0
phonenumbers >= 8.13.2
10 changes: 5 additions & 5 deletions src/nmap_scanner/nmap_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"""

import sys
import nmap
import logging
import nmap

sys.path.insert(
0,
Expand Down Expand Up @@ -73,10 +73,10 @@ def nmap_scanner(target: str, arguments: str = '',
except KeyError:
logger.raise_fatal(ValueError(f'Cannot scan {proto}'))

for port in lports:
state = nm_scan[host][proto][port]["state"]
logger.debug(f'Port: {port} State: {state}')
ports_state[port] = state
for port in lports:
state = nm_scan[host][proto][port]["state"]
logger.debug(f'Port: {port} State: {state}')
ports_state[port] = state

return ports_state
except Exception as ex:
Expand Down
9 changes: 6 additions & 3 deletions src/phone_info/phone_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"""

import sys
import folium
import logging
import opencage
import phonenumbers
from pathlib import Path

import folium
import phonenumbers
from phonenumbers import geocoder, carrier
from opencage.geocoder import OpenCageGeocode

Expand Down Expand Up @@ -47,6 +47,9 @@ def __init__(self,

@property
def number(self) -> str:
"""
Property number method.
"""
return self.__number

@number.setter
Expand Down

0 comments on commit a076bbb

Please sign in to comment.