From c6ea03c4a0d11dd8f5e794ce4fa4c137afb057b9 Mon Sep 17 00:00:00 2001 From: Jay Townsend Date: Sat, 7 Sep 2019 13:31:53 +0100 Subject: [PATCH 1/2] More ci and docs update --- .github/contributing.md | 18 ++++++++++++++++++ .github/workflows/theHarvester.yml | 3 +++ .travis.yml | 1 + mypy.ini | 3 +++ requirements.txt | 1 + 5 files changed, 26 insertions(+) create mode 100644 .github/contributing.md create mode 100644 mypy.ini diff --git a/.github/contributing.md b/.github/contributing.md new file mode 100644 index 00000000..f6f816d5 --- /dev/null +++ b/.github/contributing.md @@ -0,0 +1,18 @@ +# Contributing to theHarvester Project +Welcome to theHarvester project, so you would like to contribute. + +The following below must be met to get accepted. + +# CI +Make sure all CI passes and you do not introduce any alerts from lgtm. + +# Unit Tests +For new modules a unit test for that module is required and we use pytest. + +# Coding Standards +* No single letter variables and variable names must represent the action that it is performing +* Have static typing on functions etc + +# Submitting Bugs +If you have a bug in a module that you want to submit an issue for and know how to write python code. +Please create a unit test for that bug and submit a fix for it \ No newline at end of file diff --git a/.github/workflows/theHarvester.yml b/.github/workflows/theHarvester.yml index 12dda69e..9af33891 100644 --- a/.github/workflows/theHarvester.yml +++ b/.github/workflows/theHarvester.yml @@ -38,3 +38,6 @@ jobs: - name: Test with pytest run: | pytest + - name: Check static type checking with mypy + run: | + mypy *.py \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 991e69f2..26a2c608 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ script: - python theHarvester.py -d metasploit.com -b baidu,bing,censys,crtsh,dnsdumpster,dogpile,duckduckgo,exalead,linkedin,netcraft,threatcrowd,trello,twitter,virustotal,yahoo - pytest - flake8 . --count --show-source --statistics +- mypy *.py notifications: email: false slack: diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 00000000..0cc1b62c --- /dev/null +++ b/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +ignore_missing_imports = True +show_traceback = True \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1d6e1eed..73b56ebd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ beautifulsoup4==4.8.0 censys==0.0.8 flake8==3.7.8 grequests==0.4.0 +mypy==0.720 plotly==4.1.1 pytest==5.1.2 PyYaml==5.1.2 From c70caf4958ccba09229a979a961ee31015b298fa Mon Sep 17 00:00:00 2001 From: Jay Townsend Date: Sat, 7 Sep 2019 18:58:03 +0100 Subject: [PATCH 2/2] Disable mypy for now in CI till the issues are fixed --- .github/workflows/theHarvester.yml | 6 +++--- .travis.yml | 2 +- theHarvester/__main__.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/theHarvester.yml b/.github/workflows/theHarvester.yml index 9af33891..c006e4e9 100644 --- a/.github/workflows/theHarvester.yml +++ b/.github/workflows/theHarvester.yml @@ -38,6 +38,6 @@ jobs: - name: Test with pytest run: | pytest - - name: Check static type checking with mypy - run: | - mypy *.py \ No newline at end of file +# - name: Check static type checking with mypy +# run: | +# mypy *.py \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 26a2c608..c3cbb2ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ script: - python theHarvester.py -d metasploit.com -b baidu,bing,censys,crtsh,dnsdumpster,dogpile,duckduckgo,exalead,linkedin,netcraft,threatcrowd,trello,twitter,virustotal,yahoo - pytest - flake8 . --count --show-source --statistics -- mypy *.py +#- mypy *.py notifications: email: false slack: diff --git a/theHarvester/__main__.py b/theHarvester/__main__.py index eefeed22..533d9da6 100644 --- a/theHarvester/__main__.py +++ b/theHarvester/__main__.py @@ -37,7 +37,7 @@ def start(): dogpile, duckduckgo, github-code, google, hunter, intelx, linkedin, linkedin_links, netcraft, securityTrails, threatcrowd, - trello, twitter, vhost, virustotal, yahoo, all''') + trello, twitter, vhost, virustotal, yahoo''') parser.add_argument('-x', '--exclude', help='exclude options when using all sources', type=str) args = parser.parse_args()