added stylecheck job to github action
This commit is contained in:
1 parent
3652cebd9f
commit
2d5551b80d
3 files changed
+21
-5
No files matched your search
@@ -3,6 +3,23 @@ name: Python package
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
stylecheck:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Python 3.12
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.12
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
pip install ".[test]"
|
||||||
|
mypy src || true
|
||||||
|
mypy --install-types --non-interactive
|
||||||
|
- name: Stylecheck
|
||||||
|
run: |
|
||||||
|
mypy --strict src
|
||||||
|
pycodestyle --max-line-length 120 src
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ def format(soup: BeautifulSoup) -> None:
|
|||||||
current_sibling = None
|
current_sibling = None
|
||||||
else:
|
else:
|
||||||
current_sibling = None
|
current_sibling = None
|
||||||
|
|
||||||
participating_blocks[-1].insert_after("{% endif %}")
|
participating_blocks[-1].insert_after("{% endif %}")
|
||||||
|
|
||||||
for block in participating_blocks:
|
for block in participating_blocks:
|
||||||
|
|||||||
@@ -2,18 +2,17 @@ import bs4
|
|||||||
from .formatters import formatters
|
from .formatters import formatters
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main() -> None:
|
||||||
with open("test.html", "r") as file:
|
with open("test.html", "r") as file:
|
||||||
soup = bs4.BeautifulSoup(file, "html.parser")
|
soup = bs4.BeautifulSoup(file, "html.parser")
|
||||||
|
|
||||||
for formatter in formatters:
|
for formatter in formatters:
|
||||||
formatter.format(soup)
|
formatter.format(soup)
|
||||||
|
|
||||||
formatter = bs4.formatter.HTMLFormatter(indent=4)
|
|
||||||
with open("out.html", "w") as file:
|
with open("out.html", "w") as file:
|
||||||
file.write("{% load static %}\n")
|
file.write("{% load static %}\n")
|
||||||
file.write(soup.prettify(formatter=formatter))
|
file.write(soup.prettify(formatter=bs4.formatter.HTMLFormatter(indent=4)))
|
||||||
|
|
||||||
|
|
||||||
def command_entry():
|
def command_entry() -> None:
|
||||||
print("ok")
|
print("ok")
|
||||||
Reference in new issue
Block a user