samayer12 / cocktails

An excuse to combine data science and mixology
1 stars 0 forks source link

Refactor vinepair.py for linters #5

Closed samayer12 closed 2 years ago

samayer12 commented 2 years ago

Pylint has the following feedback for vinepair.py:

************* Module src.scrapers.vinepair
src/scrapers/vinepair.py:28:0: R0914: Too many local variables (17/15) (too-many-locals)
src/scrapers/vinepair.py:28:0: R0912: Too many branches (20/12) (too-many-branches)
src/scrapers/vinepair.py:28:0: R0915: Too many statements (52/50) (too-many-statements)
src/scrapers/vinepair.py:104:4: C0103: Constant name "vinepair_url" doesn't conform to UPPER_CASE naming style (invalid-name)

-----------------------------------
Your code has been rated at 9.83/10

And mypy says:

src/scrapers/vinepair.py:6: error: Skipping analyzing "bs4": module is installed, but missing library stubs or py.typed marker
src/scrapers/vinepair.py:6: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
src/scrapers/vinepair.py:14: error: Function is missing a type annotation
src/scrapers/vinepair.py:28: error: Function is missing a type annotation
src/scrapers/vinepair.py:101: error: Need type annotation for "recipe_links" (hint: "recipe_links: List[<type>] = ...")
src/scrapers/vinepair.py:105: error: Call to untyped function "scrape_recipe_page" in typed context
src/scrapers/vinepair.py:110: error: Call to untyped function "parse_recipe_to_yaml" in typed context
Found 6 errors in 1 file (checked 4 source files)