Commit 8dfb533e authored by Roman Yurchak's avatar Roman Yurchak Committed by oroulet

Add pre-commit-config

parent b5a6b607
......@@ -32,13 +32,24 @@ jobs:
python -m pip install pytest mypy ruff
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f dev_requirements.txt ]; then pip install -r dev_requirements.txt; fi
- name: Lint with ruff
run: |
ruff check .
- name: mypy
run: |
python -m pip install types-aiofiles types-python-dateutil types-pytz typing-extensions
python -m mypy asyncua/
- name: Test with pytest
run: |
pytest -v -s
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit
- name: Lint with ruff
run: |
pre-commit run -a
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: check-yaml
args: [--unsafe]
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.6.9'
hooks:
- id: ruff
args: ['--fix']
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.0
hooks:
- id: mypy
additional_dependencies: [types-aiofiles, types-python-dateutil, types-pytz, typing-extensions, aiosqlite, types-pyOpenSSL]
files: ^asyncua/.*
......@@ -210,3 +210,15 @@ Or
```
./run-test.sh -v -s --cov asyncua --cov-report=html
```
## Linting
To apply linting checks (including ruff, and mypy) at each commit run,
```bash
pip install pre-commit
pre-commit install
```
You can also run all linters on all files with,
```bash
pre-commit run -a
```
\ No newline at end of file
......@@ -857,5 +857,3 @@ class BadMaxConnectionsReached(UaStatusCodeError):
class BadDataSetIdInvalid(UaStatusCodeError):
code = 0x80E70000
......@@ -36,4 +36,3 @@ asyncua.client.ha.virtual\_subscription module
:members:
:undoc-members:
:show-inheritance:
......@@ -44,4 +44,3 @@ asyncua.client.ua\_file\_transfer module
:members:
:undoc-members:
:show-inheritance:
......@@ -172,4 +172,3 @@ asyncua.common.xmlparser module
:members:
:undoc-members:
:show-inheritance:
......@@ -25,4 +25,3 @@ asyncua.crypto.uacrypto module
:members:
:undoc-members:
:show-inheritance:
......@@ -124,4 +124,3 @@ asyncua.server.users module
:members:
:undoc-members:
:show-inheritance:
......@@ -20,4 +20,3 @@ asyncua.server.standard\_address\_space.standard\_address\_space\_services modul
:members:
:undoc-members:
:show-inheritance:
......@@ -10,4 +10,3 @@ asyncua.ua.uaerrors package
:members:
:undoc-members:
:show-inheritance:
......@@ -24,5 +24,3 @@ Browsing and accessing nodes
============================
.. todo:: Usage of shortcut objects (root, objects, ...)
......@@ -31,5 +31,3 @@ asyncua.crypto package
Code related to permissions, security and encryption is located in the :mod:`asyncua.crypto`
package.
......@@ -33,4 +33,3 @@ https://www.open62541.org
https://www.unified-automation.com
Unified Automation provides different products for the OPC-UA ecosystem. Most of the
tools are available as a free download with an evaluation license (non commercial use).
......@@ -16,4 +16,3 @@ Path to the standard_address_space.py files: opcua-asyncio/asyncua/server/standa
- our Github Discussions: https://github.com/FreeOpcUa/opcua-asyncio/discussions
- our Gitter Channel: https://gitter.im/FreeOpcUa/opcua-asyncio
- in case of Bugs with the updater, please make an issue: https://github.com/FreeOpcUa/opcua-asyncio/issues
\ No newline at end of file
......@@ -7,7 +7,7 @@ from pathlib import Path
logging.basicConfig(level=logging.DEBUG)
sys.path.append(f'{Path(__file__).parent.parent}')
from asyncua.tools import uaserver
from asyncua.tools import uaserver # noqa: E402
if __name__ == "__main__":
uaserver()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment