Skip to content

Commit

Permalink
pre-commit/yaml - add indenting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
commonism committed Oct 31, 2024
1 parent 6a322b1 commit ef010bd
Show file tree
Hide file tree
Showing 54 changed files with 273 additions and 278 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ labels: [bug, unconfirmed]
body:
- type: markdown
attributes:
value: Thank you for taking the time to report a problem.
value: Thank you for taking the time to report a problem.

- type: textarea
id: description
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ updates:
groups:
all:
patterns:
- "*"
- "*"
88 changes: 44 additions & 44 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,51 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python: ["3.9","3.10","3.11", "3.12", "3.13"]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@master
- uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python }}
allow-python-prereleases: true
cache: true
- name: install deps
run: |
pdm use -f $PYTHON
pdm install -d
- name: Generate coverage report (default)
run: |
pdm run pytest --cov=aiopenapi3/ --cov-report=xml:./coverage/reports/coverage-default.xml tests/
pdm run pytest --cov=tests/ --cov-report=xml:./coverage/reports/coverage-default-tests.xml tests/
- name: install optional deps
run: |
pdm install -G auth,socks
- name: Generate coverage report (options)
run: |
pdm run pytest --cov=aiopenapi3/ --cov-report=xml:./coverage/reports/coverage-optional.xml tests/
pdm run pytest --cov=tests/ --cov-report=xml:./coverage/reports/coverage-optional-tests.xml tests/
- name: Upload coverage to Codecov (core)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
files: coverage-default.xml,coverage-optional.xml
env_vars: OS,PYTHON
fail_ci_if_error: false
flags: core
name: codecov-aiopenapi3
verbose: true
- name: Upload coverage to Codecov (tests)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
files: coverage-default-tests.xml,coverage-optional-tests.xml
env_vars: OS,PYTHON
fail_ci_if_error: false
flags: tests
name: codecov-aiopenapi3-tests
verbose: true
- uses: actions/checkout@master
- uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python }}
allow-python-prereleases: true
cache: true
- name: install deps
run: |
pdm use -f $PYTHON
pdm install -d
- name: Generate coverage report (default)
run: |
pdm run pytest --cov=aiopenapi3/ --cov-report=xml:./coverage/reports/coverage-default.xml tests/
pdm run pytest --cov=tests/ --cov-report=xml:./coverage/reports/coverage-default-tests.xml tests/
- name: install optional deps
run: |
pdm install -G auth,socks
- name: Generate coverage report (options)
run: |
pdm run pytest --cov=aiopenapi3/ --cov-report=xml:./coverage/reports/coverage-optional.xml tests/
pdm run pytest --cov=tests/ --cov-report=xml:./coverage/reports/coverage-optional-tests.xml tests/
- name: Upload coverage to Codecov (core)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
files: coverage-default.xml,coverage-optional.xml
env_vars: OS,PYTHON
fail_ci_if_error: false
flags: core
name: codecov-aiopenapi3
verbose: true
- name: Upload coverage to Codecov (tests)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
files: coverage-default-tests.xml,coverage-optional-tests.xml
env_vars: OS,PYTHON
fail_ci_if_error: false
flags: tests
name: codecov-aiopenapi3-tests
verbose: true
26 changes: 13 additions & 13 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches: ["master"]
schedule:
- cron: '26 23 * * 6'

Expand All @@ -32,19 +32,19 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
language: ['python']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
Expand All @@ -55,8 +55,8 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -68,5 +68,5 @@ jobs:
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
31 changes: 16 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ repos:
hooks:
- id: pycln
- repo: 'https://github.com/psf/black'
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
args:
- "--line-length=120"
- "--line-length=120"
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v4.6.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
exclude: '^docs/[^/]*\.svg$'
Expand All @@ -31,20 +31,21 @@ repos:
hooks:
- id: flake8
args:
- "--max-line-length=120"
- "--ignore=E203,W503"
- "--select=W504"
- "--max-line-length=120"
- "--ignore=E203,W503"
- "--select=W504"
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py39-plus, --keep-runtime-typing]

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.ci hooks
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.ci hooks
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
12 changes: 6 additions & 6 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ build:

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
configuration: docs/source/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- method: pip
path: .
- requirements: docs/requirements.txt
- requirements: requirements-tests.txt
install:
- method: pip
path: .
- requirements: docs/requirements.txt
- requirements: requirements-tests.txt
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ services:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- .:/app
2 changes: 1 addition & 1 deletion tests/fixtures/extra-reduced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ components:
schemas:
A:
type: object
additionalProperties: False
additionalProperties: false
description: Additional information provided through arbitrary metadata.
allOf:
- $ref: "#/components/schemas/A0"
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/parsing-paths-content-nested-array-ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ components:
type:
type: string
enum:
- raw
- ext4
- raw
- ext4
2 changes: 1 addition & 1 deletion tests/fixtures/parsing-paths-content-schema-object.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ paths:
description: Checking example string
content:
'text/plain':
example: 'Hello'
example: 'Hello'
16 changes: 8 additions & 8 deletions tests/fixtures/parsing-paths-parameter-name-mismatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ info:
paths:
/example/{name}:
parameters:
- in: path
name: name
required: true
schema:
type: string
get:
parameters:
- in: path
name: different
name: name
required: true
schema:
type: string
get:
parameters:
- in: path
name: different
required: true
schema:
type: string
operationId: example
responses:
'200':
Expand Down
8 changes: 4 additions & 4 deletions tests/fixtures/parsing-schema-names.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ paths: {}

components:
schemas:
"Rechnungsdruck.WebApp.Controllers.Api.ApiPagedResult.PagingInformation[System.Collections.Generic.List[Billbee.Interfaces.BillbeeAPI.Model.CustomerAddressApiModel]]":
type: object
? "Rechnungsdruck.WebApp.Controllers.Api.ApiPagedResult.PagingInformation[System.Collections.Generic.List[Billbee.Interfaces.BillbeeAPI.Model.CustomerAddressApiModel]]"
: type: object
properties:
Page:
format: int32
type: integer

"Rechnungsdruck.WebApp.Controllers.Api.ApiPagedResult[System.Collections.Generic.List[Billbee.Interfaces.BillbeeAPI.Model.CustomerAddressApiModel]]":
type: object
? "Rechnungsdruck.WebApp.Controllers.Api.ApiPagedResult[System.Collections.Generic.List[Billbee.Interfaces.BillbeeAPI.Model.CustomerAddressApiModel]]"
: type: object
properties:
Paging:
$ref: "#/components/schemas/Rechnungsdruck.WebApp.Controllers.Api.ApiPagedResult.PagingInformation[System.Collections.Generic.List[Billbee.Interfaces.BillbeeAPI.Model.CustomerAddressApiModel]]"
2 changes: 1 addition & 1 deletion tests/fixtures/paths-parameter-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ paths:
type: string
default: "path"
operationId: default
responses: &resp
responses:
'200':
content:
application/json:
Expand Down
16 changes: 8 additions & 8 deletions tests/fixtures/paths-parameter-format-v20.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ paths:
get:
operationId: path
responses:
"200":
description: OK
schema:
type: string
"200":
description: OK
schema:
type: string

/query:
get:
Expand All @@ -61,10 +61,10 @@ paths:
default: "default"
operationId: query
responses:
"200":
description: OK
schema:
type: string
"200":
description: OK
schema:
type: string

'/formdata':
post:
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/paths-parameter-missing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ paths:
schema:
type: string
operationId: missing
responses: &resp
responses:
'200':
content:
application/json:
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/paths-parameter-name-invalid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ paths:
- name: "Path:"
in: path
description: ""
required: True
required: true
schema:
type: string
- name: ""
in: path
description: ""
required: True
required: true
schema:
type: string
get:
Expand Down
Loading

0 comments on commit ef010bd

Please sign in to comment.