diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 6dadd5b..258451e 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -10,9 +10,9 @@ If you believe you've found a security-related bug, fill out a new vulnerability follow these instructions: 1. Click on the `Security` tab in the project repository. -2. Click the green `Report a vulnerability` button at the top right corner. -3. Fill in the form as accurately as you can, including as many details as possible. -4. Click the green `Submit report` button at the bottom. +1. Click the green `Report a vulnerability` button at the top right corner. +1. Fill in the form as accurately as you can, including as many details as possible. +1. Click the green `Submit report` button at the bottom. ## Don't have a GitHub account? diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index a0083b8..3c27013 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -7,14 +7,11 @@ on: pull_request: schedule: - cron: "0 8 * * *" - concurrency: group: check-${{ github.ref }} cancel-in-progress: true - permissions: contents: read - jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9994594..7fa5813 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,13 +2,10 @@ name: Release to PyPI on: push: tags: ["*"] - permissions: contents: read - env: dists-artifact-name: python-package-distributions - jobs: build: runs-on: ubuntu-latest @@ -30,7 +27,6 @@ jobs: with: name: ${{ env.dists-artifact-name }} path: dist/* - release: needs: - build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08b3d37..eca97cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,11 +28,20 @@ repos: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.9.5" - hooks: - - id: prettier - args: ["--print-width=120", "--prose-wrap=always"] + - repo: https://github.com/google/yamlfmt + rev: "v0.21.0" + hooks: + - id: yamlfmt + - repo: local + hooks: + - id: mdformat + name: mdformat + entry: mdformat --wrap 120 + language: python + types: [markdown] + additional_dependencies: + - mdformat-gfm>=1 + - mdformat-ruff>=0.1.3 - repo: https://github.com/zizmorcore/zizmor-pre-commit rev: v1.26.1 hooks: diff --git a/README.md b/README.md index 25ca47b..08473a3 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,15 @@ This library provides the following fixtures that help you print messages within output capture, so it will show up in the standard output, even if the test passes): - `printer: Printter` - function level fixture, when called prints a message line (with very simple formatting), + - [`printer_session: Printter`](#example-printer_session) - session scoped fixture same as above but using (this exists as a backwards compatibility layer, as we didn't want to switch the originally function scope variant to session one), + - [`pretty_printer: PrettyPrintter`](#example-pretty_printer) - session scoped fixture, when called prints a message line (with fancy formatting of space for indentation, `⏩` icon for every message, and elapsed time format in form of `[{elapsed:.20f}]`) and also allows creating a printer that will be indented one level deeper (and optionally use a different icon). + - [`create_pretty_printer: PrettyPrinterFactory`](#example-create_pretty_printer) - allows the caller to customize the fancy formatter as they wish. Takes one `formatter` argument, whose arguments should be interpreted as: @@ -168,12 +171,12 @@ if TYPE_CHECKING: @pytest.fixture(scope="session") def pretty(create_pretty_printer: PrettyPrinterFactory) -> PrettyPrinter: formatter = Formatter( - indentation=" I ", - head=" H ", - space=" S ", - icon="🧹", - timer_fmt="[{elapsed:.5f}]", - ) + indentation=" I ", + head=" H ", + space=" S ", + icon="🧹", + timer_fmt="[{elapsed:.5f}]", + ) return create_pretty_printer(formatter=formatter)