🔨 Apply pydocstyle to project

This commit is contained in:
freezed 2022-12-06 00:56:46 +01:00
parent e221555e94
commit e3791e847e
4 changed files with 19 additions and 1 deletions

View File

@ -20,6 +20,7 @@ init-pre_commit: # Set up git pre-commit hook
lint: # Lint code
${VBIN}/black --quiet --check *.py && echo "✅ black" || echo "🚨 black"
${VBIN}/pydocstyle && echo "✅ pydocstyle" || echo "🚨 pydocstyle"
open_all: # Open all projects files
${EDITOR} ${VBIN}/activate

View File

@ -46,7 +46,7 @@ Rajouter le code sous-titre en paramètre:
### 🚀 Chauffe Marcel!
- `Python 3.10` à été utilisé
- Code formaté avec [`black`](https://pypi.org/project/black)
- Code formaté avec [`black`](https://pypi.org/project/black) & [`pydocstyle`](https://pypi.org/project/pydocstyle/)
- Installation des outils de développement:
* `pip install -r requirements-dev.txt`
- Un `Makefile` équipé: executer `make help` pour le détail

View File

@ -1,3 +1,16 @@
#!/usr/bin/env python3
# coding:utf-8
"""delarte.
Retrieve video stream in a local file, including sub-titles
Licence: GNU AGPL v3: http://www.gnu.org/licenses/
This file is part of [`delarte`](https://git.afpy.org/fcode/delarte)
"""
import json
import sys
import re
@ -17,6 +30,7 @@ FFMPEG = environ.get("PATH_FFMPEG", "ffmpeg path not found")
def call_api(api_url):
"""Retrieve subtitles versions available for a given URL."""
http_response = urlopen(api_url)
if http_response.status != HTTPStatus.OK:
@ -35,6 +49,7 @@ def call_api(api_url):
def write_subtitles(m3u8_url, base_name):
"""Convert distant vtt subtitles to local srt."""
main = m3u8.load(m3u8_url)
sub_m3u8_urls = [

View File

@ -1 +1,3 @@
black
pydocstyle
toml