Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Pre-commit added
Browse files Browse the repository at this point in the history
  • Loading branch information
superDross committed Dec 3, 2019
1 parent 0fbac84 commit a191b01
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 21 deletions.
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: master
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-yaml
- id: detect-private-key
- id: requirements-txt-fixer

- repo: https://github.com/timothycrosley/isort
rev: 4.3.21-2
hooks:
- id: isort
args: [--check-only, --diff, -ws, -tc, -o=tabulate, -w, "88", romember/*.py, romember/tests/*.py]

- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
language_version: python3.7
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
bs4>=0.0.1
reportlab>=3.5.23
Pillow>=3.1.2
requests>=2.18.4
tabulate>=0.8.1
lxml>=4.2.5
Pillow>=3.1.2
PyQt5>=5.13.0
pytest>=5.3.1
pytest-cov>=2.8.1
pytest>=5.3.1
reportlab>=3.5.23
requests>=2.18.4
tabulate>=0.8.1
2 changes: 1 addition & 1 deletion scraper/search.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
from typing import List, Dict
from typing import Dict, List

from tabulate import tabulate

Expand Down
5 changes: 2 additions & 3 deletions scraper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from logging import Logger, LoggerAdapter
from typing import Callable, Tuple

import requests

import bs4
import requests

logger = logging.getLogger(__name__)

Expand All @@ -17,7 +16,7 @@ class CustomAdapter(LoggerAdapter):
"""

def process(self, msg: str, kwargs: dict) -> Tuple[str, dict]:
manga = self.extra.get("manga").replace('-', ' ').title()
manga = self.extra.get("manga").replace("-", " ").title()
volume = self.extra.get("volume")
if volume:
return f"[{manga}:{volume}] {msg}", kwargs
Expand Down
4 changes: 2 additions & 2 deletions tests/test_files/dragonball_bardock_volume_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
document['nl'] = '/dragon-ball-episode-of-bardock/2/2';
document['pl'] = '/dragon-ball-episode-of-bardock/1/20';
document['pu'] = 'https://i7.mangareader.net/dragon-ball-episode-of-bardock/2/dragon-ball-episode-of-bardock-2555265.jpg';

function omvKeyPressed(e) {
var keyCode = 0;
if (navigator.appName == "Microsoft Internet Explorer") {
Expand Down Expand Up @@ -85,7 +85,7 @@
case 39:
window.location = "/dragon-ball-episode-of-bardock/2/2";
return false;

default:
return true;
}
Expand Down
16 changes: 8 additions & 8 deletions tests/test_files/dragonball_bardock_volume_2_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
document['nl'] = '/dragon-ball-episode-of-bardock/2/5';
document['pl'] = '/dragon-ball-episode-of-bardock/2/3';
document['pu'] = 'https://i1.mangareader.net/dragon-ball-episode-of-bardock/2/dragon-ball-episode-of-bardock-2555271.jpg';

function omvKeyPressed(e) {
var keyCode = 0;
if (navigator.appName == "Microsoft Internet Explorer") {
Expand Down Expand Up @@ -85,7 +85,7 @@
case 39:
window.location = "/dragon-ball-episode-of-bardock/2/5";
return false;

default:
return true;
}
Expand Down Expand Up @@ -375,7 +375,7 @@ <h3>Dragon Ball: Episode of Bardock 2 Manga Relations</h3>
document['nl'] = '/dragon-ball-episode-of-bardock/2/2';
document['pl'] = '/dragon-ball-episode-of-bardock/1/20';
document['pu'] = 'https://i7.mangareader.net/dragon-ball-episode-of-bardock/2/dragon-ball-episode-of-bardock-2555265.jpg';

function omvKeyPressed(e) {
var keyCode = 0;
if (navigator.appName == "Microsoft Internet Explorer") {
Expand Down Expand Up @@ -403,7 +403,7 @@ <h3>Dragon Ball: Episode of Bardock 2 Manga Relations</h3>
case 39:
window.location = "/dragon-ball-episode-of-bardock/2/2";
return false;

default:
return true;
}
Expand Down Expand Up @@ -693,7 +693,7 @@ <h3>Dragon Ball: Episode of Bardock 2 Manga Relations</h3>
document['nl'] = '/dragon-ball-episode-of-bardock/2/3';
document['pl'] = '/dragon-ball-episode-of-bardock/2';
document['pu'] = 'https://i7.mangareader.net/dragon-ball-episode-of-bardock/2/dragon-ball-episode-of-bardock-2555267.jpg';

function omvKeyPressed(e) {
var keyCode = 0;
if (navigator.appName == "Microsoft Internet Explorer") {
Expand Down Expand Up @@ -721,7 +721,7 @@ <h3>Dragon Ball: Episode of Bardock 2 Manga Relations</h3>
case 39:
window.location = "/dragon-ball-episode-of-bardock/2/3";
return false;

default:
return true;
}
Expand Down Expand Up @@ -1011,7 +1011,7 @@ <h3>Dragon Ball: Episode of Bardock 2 Manga Relations</h3>
document['nl'] = '/dragon-ball-episode-of-bardock/2/4';
document['pl'] = '/dragon-ball-episode-of-bardock/2/2';
document['pu'] = 'https://i7.mangareader.net/dragon-ball-episode-of-bardock/2/dragon-ball-episode-of-bardock-2555269.jpg';

function omvKeyPressed(e) {
var keyCode = 0;
if (navigator.appName == "Microsoft Internet Explorer") {
Expand Down Expand Up @@ -1039,7 +1039,7 @@ <h3>Dragon Ball: Episode of Bardock 2 Manga Relations</h3>
case 39:
window.location = "/dragon-ball-episode-of-bardock/2/4";
return false;

default:
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_files/dragonball_search.html
Original file line number Diff line number Diff line change
Expand Up @@ -522,4 +522,4 @@ <h2>Author/Artist Results</h2>
</script>
<script type="text/javascript" src="https://srv.aftv-serving.bid/public/js/aftv_v1.js"></script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- use pathlib instea of os module
- mypy for type checking

- Travis CI
- Travis CI i
- setup tools sorted so a proper installation process can work
- upload to pypi

Expand Down

0 comments on commit a191b01

Please sign in to comment.