Skip to content

Commit

Permalink
Merge branch 'poetry' into reddit-nsfw-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Defelo authored Apr 3, 2022
2 parents e2fff8b + 6a4fe78 commit aca37eb
Show file tree
Hide file tree
Showing 172 changed files with 4,524 additions and 1,499 deletions.
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[flake8]
max-line-length = 120
ignore = D,E800,F401,F403,F405,I,Q000,RST210,RST213,RST215,RST304,S311,WPS
ignore = C812,C813,C815,C816,Q000,RST210,RST213,RST215,RST304,W503
extend-ignore = D,E800,S311,WPS
78 changes: 60 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- pull_request

env:
PYTHON_VERSION: 3.9
PYTHON_VERSION: "3.10"

jobs:
codestyle:
Expand All @@ -14,45 +14,81 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install black
- name: Setup poetry
run: |
pip install --upgrade pip
pip install black==20.8b1
- name: Check code formatting with black
run: black -l 120 . --diff --check
pip install poetry poethepoet
poetry install -n --no-root
- name: Check code formatting with black and isort
run: poe black --diff --check && poe isort --diff --check

# mypy:
# if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository }}
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - name: Set up Python ${{ env.PYTHON_VERSION }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ env.PYTHON_VERSION }}
#
# - name: Setup poetry
# run: |
# pip install poetry poethepoet
# poetry install -n --no-root
#
# - name: Check typing with mypy
# run: poe mypy

linter:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
submodules: recursive

- name: Lint with wemake-python-styleguide
uses: wemake-services/wemake-python[email protected]
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
reporter: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && 'github-pr-review' || 'terminal' }}
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup poetry
run: |
pip install poetry poethepoet
poetry install -n --no-root
- name: Check code style with wemake-python-styleguide
run: poe flake8

# - name: Lint with wemake-python-styleguide
# uses: wemake-services/[email protected]
# with:
# reporter: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && 'github-pr-review' || 'terminal' }}
# env:
# GITHUB_TOKEN: ${{ secrets.github_token }}

docs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
submodules: recursive

Expand All @@ -65,19 +101,25 @@ jobs:
exit 1
fi
for category in administration moderation information integrations general; do
ok=1
for category in */; do
cd $category
for cog in $(ls); do
[[ -d $cog ]] || continue
if ! [[ -f $cog/documentation.md ]]; then
echo ::warning::Could not find documentation for $category/$cog
ok=0
echo ::error::Could not find documentation for $category$cog
fi
done
cd ..
done
if [[ $ok -ne 1 ]]; then
exit 1
fi
- name: Lint docs
uses: docker://avtodev/markdown-lint:v1
with:
Expand Down
Loading

0 comments on commit aca37eb

Please sign in to comment.