Skip to content

Commit

Permalink
Merge branch 'develop' into add_gitlab_fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa authored Apr 12, 2024
2 parents 71b0ca0 + a247aef commit cadbe62
Show file tree
Hide file tree
Showing 54 changed files with 74 additions and 12 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,26 @@ jobs:
- name: Install tox
run: python -m pip install tox

- name: "Set lint/docs env var"
- name: "Set LINT_DOCS"
if: matrix.python-version == '3.9'
run: |
echo "LINT_DOCS=,lint,docs" >> $GITHUB_ENV
- name: "Set TOX_ENV on Windows"
if: matrix.os == 'windows-latest'
run: |
$pythonVersion = "${{ matrix.python-version }}"
$TOX_ENV = "py" + $pythonVersion.Replace('.', '')
echo "TOX_ENV=$TOX_ENV" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: "Set TOX_ENV on Linux/macOS"
if: matrix.os != 'windows-latest'
run: |
echo "TOX_ENV=$(echo py${{ matrix.python-version }} | tr -d .)" >> $GITHUB_ENV
- name: "Run tests on ${{ matrix.os }}"
run: |
tox -e clean,$(echo py${{ matrix.python-version }} | tr -d .)${{env.LINT_DOCS}},report
tox -e clean,${{env.TOX_ENV}}${{env.LINT_DOCS}},report
# https://github.com/marketplace/actions/coveralls-python
# The official coverallsapp/github-action@master doesn't work: https://github.com/marketplace/actions/coveralls-github-action
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ repos:
types: [python, toml]
stages: [commit]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/google/keep-sorted
rev: v0.3.0
rev: v0.4.0
hooks:
- id: keep-sorted
- repo: https://github.com/pappasam/toml-sort
Expand All @@ -52,7 +52,7 @@ repos:
# - poetry.lock: auto-generated file
exclude: (ideas/|resources/|tests/|poetry.lock)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.3.5
hooks:
- id: ruff
args: [--fix]
Expand All @@ -66,7 +66,7 @@ repos:
hooks:
- id: sort-all
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.3.0
hooks:
- id: black
args: [--safe, --quiet]
Expand All @@ -86,7 +86,7 @@ repos:
- id: prettier
stages: [commit]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
# https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-show-error-codes
Expand Down Expand Up @@ -121,7 +121,7 @@ repos:
types: [python]
exclude: tests/
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/openstack/bashate
Expand All @@ -131,7 +131,7 @@ repos:
# https://docs.openstack.org/bashate/latest/man/bashate.html#options
args: [-i, E006]
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.13.0
rev: v3.21.3
hooks:
- id: commitizen
stages: [commit-msg]
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
poetry 1.7.1
pre-commit 3.3.2
pre-commit 3.7.0
1 change: 1 addition & 0 deletions docs/autofix_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
It doesn't recognise the "styles" dir anywhere (on the root, under "docs", under "_static"...).
Not even changing ``html_static_path`` on ``conf.py`` worked.
"""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
full list see the documentation:
http://www.sphinx-doc.org/en/master/config
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions docs/ideas/lab.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Laboratory of Nitpick ideas."""

import json
from pathlib import Path
from pprint import pprint
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ imagesize==1.4.1 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==6.8.0 ; python_version >= "3.8" and python_version < "3.10"
importlib-resources==6.1.0 ; python_version >= "3.8" and python_version < "3.9"
iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.2 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.3 ; python_version >= "3.8" and python_version < "4.0"
jmespath==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
jsonschema-specifications==2023.7.1 ; python_version >= "3.8" and python_version < "4.0"
jsonschema==4.19.1 ; python_version >= "3.8" and python_version < "4.0"
Expand Down Expand Up @@ -57,7 +57,7 @@ sphinx-gitref==0.2.1 ; python_version >= "3.8" and python_version < "4.0"
sphinx-rtd-theme==1.3.0 ; python_version >= "3.8" and python_version < "4.0"
sphinx==6.2.1 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-applehelp==1.0.4 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-devhelp==1.0.6 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-htmlhelp==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-jquery==4.1 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main module."""

from loguru import logger

from nitpick.constants import PROJECT_NAME
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- https://www.python.org/dev/peps/pep-0338/
- https://docs.python.org/3/using/cmdline.html#cmdoption-m
"""

from nitpick.cli import nitpick_cli # pragma: no cover
from nitpick.constants import PROJECT_NAME # pragma: no cover

Expand Down
1 change: 1 addition & 0 deletions src/nitpick/blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from nitpick.generic import *
"""

from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Also see (1) from https://click.palletsprojects.com/en/5.x/setuptools/#setuptools-integration
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/compat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Handle import compatibility issues."""

# pylint: skip-file
try:
from importlib.abc import Traversable # type: ignore[attr-defined]
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Special configurations."""

from attr import Factory, define # type: ignore[attr-defined]

from nitpick.typedefs import JsonDict
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The Nitpick application and project-related utilities."""

from __future__ import annotations

import itertools
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nitpick exceptions."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/fields.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom Marshmallow fields and validators."""

import json

from marshmallow import ValidationError, fields
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/flake8.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Flake8 plugin to check files."""

import logging
from functools import lru_cache
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from nitpick.generic import *
"""

from __future__ import annotations

import subprocess
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The hook specifications and the plugin classes are still experimental and considered as an internal API.
They might change at any time; use at your own risk.
"""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/plugins/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base class for file checkers."""

from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/plugins/info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Info needed by the plugins."""

from __future__ import annotations

from dataclasses import dataclass, field
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/plugins/ini.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""INI files."""

from __future__ import annotations

from configparser import ConfigParser, DuplicateOptionError, Error, MissingSectionHeaderError, ParsingError
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/plugins/json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""JSON files."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/plugins/text.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Text files."""

from __future__ import annotations

from typing import TYPE_CHECKING, ClassVar, Iterator
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/plugins/toml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""TOML files."""

from __future__ import annotations

from itertools import chain
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/plugins/yaml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""YAML files."""

from __future__ import annotations

from itertools import chain
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/schemas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Marshmallow schemas."""

from __future__ import annotations

from marshmallow import Schema
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/style.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Style parsing and merging."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/tomlkit_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Eventually, some of the code here should/could be proposed as pull requests to the original package.
"""

from __future__ import annotations

from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions src/nitpick/typedefs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Type definitions."""

from pathlib import Path
from typing import Any, Dict, Iterable, List, Tuple, Type, Union

Expand Down
1 change: 1 addition & 0 deletions src/nitpick/violations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Name inspired by `flake8's violations <https://flake8.pycqa.org/en/latest/user/error-codes.html>`_.
"""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- https://www.pyinvoke.org/
- https://docs.pyinvoke.org/en/stable/api/runners.html#invoke.runners.Runner.run
"""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.tox/py38/lib/python3.8/site-packages/pytest_cov/plugin.py:271:
PytestWarning: Failed to generate report: No data to report.
"""

import logging
from pathlib import Path
from textwrap import dedent
Expand Down
1 change: 1 addition & 0 deletions tests/data/hello.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Some empty Python file."""

x = 1
print(x)
1 change: 1 addition & 0 deletions tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test helpers."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions tests/test_builtin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test built-in styles shipped as resources under the ``nitpick.resources`` module."""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cache."""

from datetime import timedelta

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CLI tests."""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions tests/test_generic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generic functions tests."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions tests/test_ini.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test INI files."""

from configparser import ParsingError
from unittest import mock

Expand Down
1 change: 1 addition & 0 deletions tests/test_json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""JSON tests."""

import warnings

from nitpick.constants import JAVASCRIPT_PACKAGE_JSON, READ_THE_DOCS_URL
Expand Down
1 change: 1 addition & 0 deletions tests/test_meta.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Meta tests for sanity check purposes."""

import json
from configparser import ConfigParser
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Plugin tests."""

import os
from enum import Enum

Expand Down
1 change: 1 addition & 0 deletions tests/test_project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config tests."""

import os
import shutil

Expand Down
1 change: 1 addition & 0 deletions tests/test_style.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Style tests."""

import warnings
from pathlib import Path
from textwrap import dedent
Expand Down
1 change: 1 addition & 0 deletions tests/test_text.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Text file tests."""

from nitpick.constants import READ_THE_DOCS_URL
from nitpick.violations import Fuss
from tests.helpers import NBSP, SUGGESTION_BEGIN, SUGGESTION_END, ProjectMock
Expand Down
1 change: 1 addition & 0 deletions tests/test_toml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""TOML tests."""

from nitpick.constants import PYTHON_PYPROJECT_TOML
from nitpick.plugins.toml import TomlPlugin
from nitpick.violations import Fuss, SharedViolations
Expand Down
Loading

0 comments on commit cadbe62

Please sign in to comment.