Skip to content

Commit

Permalink
Merge pull request #138 from AceFire6/jethro/add/linting_checks
Browse files Browse the repository at this point in the history
Add linting checks
  • Loading branch information
AceFire6 authored Aug 31, 2019
2 parents c7f4348 + 9ee9a5a commit 83e28ae
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: python
python:
- "3.7"

install:
- pip install -r requirements.txt

script:
- flake8 .
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Arrowverse Series Ordering
[![Build Status](https://travis-ci.org/AceFire6/ordered-arrowverse.svg?branch=master)](https://travis-ci.org/AceFire6/ordered-arrowverse)

This is a project that aims to centralize the series in the Arrowverse that
have crossovers so as to make it easy to watch the episodes in the correct
Expand Down
13 changes: 8 additions & 5 deletions ordering/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def get_episode_list(series_soup, series):
wikipedia_row_unpacker = itemgetter(episode_num_index, title_index, air_date_index)

table = [
[episode_row_col.getText() for episode_row_col in wikipedia_row_unpacker(episode_row.contents)]
[
episode_row_col.getText()
for episode_row_col in wikipedia_row_unpacker(episode_row.contents)
]
for episode_row in table.find_all(class_='vevent')
]

Expand Down Expand Up @@ -135,16 +138,16 @@ def _handle_crisis_on_earth_x_order_error(episode_list, shows_in_list):
if ARROW in episode_indices and SUPERGIRL in episode_indices:
arrow_index = episode_indices[ARROW]
supergirl_index = episode_indices[SUPERGIRL]
indices = sorted([arrow_index, supergirl_index])
first_index, second_index = sorted([arrow_index, supergirl_index])

episode_list[supergirl_index], episode_list[arrow_index] = episode_list[indices[0]], episode_list[indices[1]]
episode_list[supergirl_index], episode_list[arrow_index] = episode_list[first_index], episode_list[second_index] # noqa: E501

if FLASH in episode_indices and LEGENDS_OF_TOMORROW in episode_indices:
flash_index = episode_indices[FLASH]
legends_index = episode_indices[LEGENDS_OF_TOMORROW]
indices = sorted([flash_index, legends_index])
first_index, second_index = sorted([flash_index, legends_index])

episode_list[flash_index], episode_list[legends_index] = episode_list[indices[0]], episode_list[indices[1]]
episode_list[flash_index], episode_list[legends_index] = episode_list[first_index], episode_list[second_index] # noqa: E501


def _handle_john_con_noir_episode(episode_list):
Expand Down
65 changes: 64 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ quart = "^0.10.0"
quart-minify = "^0.1.0"
quart-compress = "^0.1.0"
feedgen = "^0.7.0"
flake8 = "^3.7"
flake8-quotes = "^2.1"

[tool.poetry.dev-dependencies]

Expand Down
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ certifi==2019.6.16
chardet==3.0.4
Click==7.0
cssmin==0.2.0
entrypoints==0.3
feedgen==0.7.0
flake8==3.7.8
flake8-quotes==2.1.0
Flask==1.1.1
Flask-Assets==0.12
Flask-Caching==1.7.2
Expand All @@ -24,9 +27,12 @@ jsmin==2.2.2
lesscpy==0.13.0
lxml==4.4.1
MarkupSafe==1.1.1
mccabe==0.6.1
multidict==4.5.2
ply==3.11
priority==1.3.0
pycodestyle==2.5.0
pyflakes==2.1.1
python-dateutil==2.8.0
Quart==0.10.0
quart-compress==0.1.0
Expand Down

0 comments on commit 83e28ae

Please sign in to comment.