From 78f1fdfc17e9a7d4204fe1f43a05129c11f90f9e Mon Sep 17 00:00:00 2001 From: Leonardo Gregianin Date: Wed, 8 Nov 2023 11:40:44 -0400 Subject: [PATCH] =?UTF-8?q?Utiliza=20ruff=20para=20qualidade=20de=20c?= =?UTF-8?q?=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 6 +++--- README.md | 7 +++++++ pyproject.toml | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c708edba..36c72e06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,10 +23,10 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install Flake8-pyproject + python -m pip install --upgrade pip pip install -r requirements.txt - pip install flake8 pytest + pip install ruff pytest - name: Lint - run: flake8 . --count --show-source --statistics + run: ruff check --output-format=github . - name: Tests run: pytest -v diff --git a/README.md b/README.md index b96127c6..7baf565b 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,13 @@ Testes python -m unittest ``` +Lint +----------- + +Instalação: `pip install ruff` +Checar lint: `ruff check .` +Formatar: `ruff format .` + Documentação ----------- diff --git a/pyproject.toml b/pyproject.toml index 2446d5cb..6ed99424 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = ["setuptools>=42"] build-backend = "setuptools.build_meta" -[tool.flake8] -per-file-ignores = [ - '/pynfe/entidades/__init__.py:F401' +[tool.ruff] +exclude = [ + 'pynfe/entidades/__init__.py' ] -max-line-length = 100 \ No newline at end of file +line-length = 100 \ No newline at end of file