Skip to content

Commit

Permalink
Rework lint (esphome#1924)
Browse files Browse the repository at this point in the history
  • Loading branch information
OttoWinter committed Feb 20, 2022
1 parent 1a1baf9 commit 4ee8df7
Show file tree
Hide file tree
Showing 44 changed files with 507 additions and 313 deletions.
46 changes: 23 additions & 23 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/python-3
{
"name": "ESPHome - docs",
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.6",
"postCreateCommand": "pip3 install -r requirements.txt",
"forwardPorts": [8000],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},
"name": "ESPHome - docs",
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.6",
"postCreateCommand": "pip3 install -r requirements.txt -r requirements_test.txt",
"forwardPorts": [8000],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},

"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
]
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
]
}
12 changes: 8 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ jobs:
with:
python-version: 3.8
- name: Install dependencies
run: pip install -r requirements.txt
- name: Lint
run: pip install -r requirements.txt -r requirements_test.txt
- name: Register problem matchers
run: |
python travis.py
make html-strict
echo "::add-matcher::.github/workflows/matchers/ci-custom.json"
- name: Lint
run: python lint.py
- name: html-strict
run: make html-strict
16 changes: 16 additions & 0 deletions .github/workflows/matchers/ci-custom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "ci-custom",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s+lint:\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ copy-svg2png:
netlify: netlify-dependencies netlify-api html copy-svg2png

lint: html-strict
python3 travis.py
python3 lint.py

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down
2 changes: 1 addition & 1 deletion changelog/2022.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ESPHome 2022.2.0 - 16th February 2022

Touchscreen Core, components/touchscreen/index, folder-open.svg
EKTF2232, components/touchscreen/ektf2232, ektf2232.svg
Lilygo T5 4.7", components/touchscreen/lilygo_t5_47, lilygo_t5_47_touch.png
Lilygo T5 4.7", components/touchscreen/lilygo_t5_47, lilygo_t5_47_touch.jpg
MLX90393, components/sensor/mlx90393, mlx90393.jpg

Wake-on-LAN Button, components/button/wake_on_lan, power_settings.svg
Expand Down
Empty file modified components/climate/ir_climate.rst
100755 → 100644
Empty file.
Empty file modified components/sensor/images/dsmr-request-pin-circuit-example.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion components/sensor/pmsa003i.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PMSA003I Particulate Matter Sensor

.. seo::
:description: Instructions for setting up PMSX003 Particulate matter sensors
:image: pmsa003i-full.jpg
:image: pmsa003i.jpg

The ``pmsa003i`` sensor platform allows you to use your Plantower PMSA003I
particulate matter sensor
Expand Down
Empty file modified components/switch/images/safemode-ui.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion components/touchscreen/lilygo_t5_47.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Lilygo T5 4.7" Touchscreen

.. seo::
:description: Instructions for setting up the Lilygo T5 4.7" Touchscreen with ESPHome
:image: lilygo_t5_47_touch.png
:image: lilygo_t5_47_touch.jpg
:keywords: Lilygo T5 4.7" Touchscreen

The ``liygo_t5_47`` touchscreen platform allows using the touchscreen controller
Expand Down
Binary file modified cookbook/images/leak-detector-m5stickC_LeakDetected.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified devices/images/sonoff_t1_uk_3g_backplate_v1.1.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified devices/images/sonoff_t1_uk_3g_touchpads_v1.1.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/donate-patreon.png
Binary file not shown.
Binary file removed images/donate-paypal.png
Binary file not shown.
Binary file modified images/esp32-modbus.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/improv-social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions images/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,10 @@ Images
This is a dummy file to include images in the sphinx output
that will only be used in raw HTML and thus not auto-included.

.. image:: shield-donate.svg

.. image:: hero.png

.. image:: logo.svg

.. image:: logo-core.svg

.. image:: logo-docs.svg

.. image:: logo-flasher.svg

.. image:: logo-release.svg

.. image:: logo-text.svg

.. image:: donate-patreon.png

.. image:: donate-paypal.png
Binary file added images/lilygo_t5_47_touch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/lilygo_t5_47_touch.png
Binary file not shown.
Binary file modified images/mcp3008.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/mcp3204.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/pipsolar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/pmsa003i-full.jpg
Binary file not shown.
Binary file modified images/pwm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/rf_bridge.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/rs485.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/scd30.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sgp40.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion images/shield-donate.svg

This file was deleted.

Binary file modified images/sht4x.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sps30.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/teleinfo-full.jpg
Binary file not shown.
Binary file modified images/tuya.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/vl53l0x.jpg
Binary file modified images/xiaomi_miscale1&2.jpg
Binary file modified images/xiaomi_miscale2.jpg
3 changes: 1 addition & 2 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ Touchscreen Components

Touchscreen Core, components/touchscreen/index, folder-open.svg
EKTF2232, components/touchscreen/ektf2232, ektf2232.svg, Inkplate 6 Plus
Lilygo T5 4.7", components/touchscreen/lilygo_t5_47, lilygo_t5_47_touch.png
Lilygo T5 4.7", components/touchscreen/lilygo_t5_47, lilygo_t5_47_touch.jpg

Cover Components
----------------
Expand Down Expand Up @@ -720,7 +720,6 @@ documentation for others to copy. See :doc:`Contributing </guides/contributing>`
:hidden:

web-api/index
misc/index
components/index
cookbook/index
devices/index
Expand Down
Loading

0 comments on commit 4ee8df7

Please sign in to comment.