Browse Source

🔧 Add pre-commit with first config and first formatting pass (#4888)

* 🔧 Add first pre-commit config

* 🎨 Format YAML files with pre-commit

* 🎨 Format Markdown with pre-commit

* 🎨 Format SVGs, drawio, JS, HTML with pre-commit

*  Add pre-commit to dev dependencies

* ⬇️ Extend pre-commit range to support Python 3.6
pull/4891/head
Sebastián Ramírez 3 years ago
committed by GitHub
parent
commit
3d0f130ff3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      .pre-commit-config.yaml
  2. 1
      docs/pl/docs/tutorial/index.md
  3. 1
      docs/pt/docs/python-types.md
  4. 1
      docs/tr/docs/features.md
  5. 1
      docs/zh/docs/advanced/response-directly.md
  6. 1
      docs/zh/docs/help-fastapi.md
  7. 1
      docs/zh/docs/tutorial/dependencies/global-dependencies.md
  8. 1
      docs/zh/docs/tutorial/request-forms-and-files.md
  9. 1
      docs/zh/docs/tutorial/security/oauth2-jwt.md
  10. 1
      pyproject.toml

14
.pre-commit-config.yaml

@ -0,0 +1,14 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-added-large-files
- id: check-toml
- id: check-yaml
args:
- --unsafe
- id: end-of-file-fixer
- id: trailing-whitespace

1
docs/pl/docs/tutorial/index.md

@ -78,4 +78,3 @@ Jest też **Zaawansowany poradnik**, który możesz przeczytać po lekturze tego
Najpierw jednak powinieneś przeczytać **Samouczek** (czytasz go teraz).
Ten rozdział jest zaprojektowany tak, że możesz stworzyć kompletną aplikację używając tylko informacji tutaj zawartych, a następnie rozszerzać ją na różne sposoby, w zależności od potrzeb, używając kilku dodatkowych pomysłów z **Zaawansowanego poradnika**.

1
docs/pt/docs/python-types.md

@ -313,4 +313,3 @@ O importante é que, usando tipos padrão de Python, em um único local (em vez
!!! info "Informação"
Se você já passou por todo o tutorial e voltou para ver mais sobre os tipos, um bom recurso é <a href = "https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html" class = "external-link "target =" _ blank "> a "cheat sheet" do `mypy` </a>.

1
docs/tr/docs/features.md

@ -206,4 +206,3 @@ Aynı şekilde, databaseden gelen objeyi de **direkt olarak isteğe** de tamamiy
* **Genişletilebilir**:
* Pydantic özelleştirilmiş data tiplerinin tanımlanmasının yapılmasına izin veriyor ayrıca validator decoratorü ile senin doğrulamaları genişletip, kendi doğrulayıcılarını yazmana izin veriyor.
* 100% test kapsayıcılığı.

1
docs/zh/docs/advanced/response-directly.md

@ -62,4 +62,3 @@
但是你仍可以参考 [OpenApI 中的额外响应](additional-responses.md){.internal-link target=_blank} 给响应编写文档。
在后续的章节中你可以了解到如何使用/声明这些自定义的 `Response` 的同时还保留自动化的数据转换和文档等。

1
docs/zh/docs/help-fastapi.md

@ -146,4 +146,3 @@ GitHub Issues 里提供了模板,指引您提出正确的问题,有利于获
---
谢谢!🚀

1
docs/zh/docs/tutorial/dependencies/global-dependencies.md

@ -15,4 +15,3 @@
## 为一组路径操作定义依赖项
稍后,[大型应用 - 多文件](../../tutorial/bigger-applications.md){.internal-link target=_blank}一章中会介绍如何使用多个文件创建大型应用程序,在这一章中,您将了解到如何为一组*路径操作*声明单个 `dependencies` 参数。

1
docs/zh/docs/tutorial/request-forms-and-files.md

@ -35,4 +35,3 @@ FastAPI 支持同时使用 `File` 和 `Form` 定义文件和表单字段。
## 小结
在同一个请求中接收数据和文件时,应同时使用 `File``Form`

1
docs/zh/docs/tutorial/security/oauth2-jwt.md

@ -263,4 +263,3 @@ OAuth2 具有「作用域」的概念。
而且你可以用相对简单的方式使用和实现安全、标准的协议,比如 OAuth2。
你可以在**进阶用户指南**中了解更多关于如何使用 OAuth2 「作用域」的信息,以实现更精细的权限系统,并同样遵循这些标准。带有作用域的 OAuth2 是很多大的认证提供商使用的机制,比如 Facebook、Google、GitHub、微软、Twitter 等,授权第三方应用代表用户与他们的 API 进行交互。

1
pyproject.toml

@ -85,6 +85,7 @@ dev = [
"autoflake >=1.4.0,<2.0.0",
"flake8 >=3.8.3,<4.0.0",
"uvicorn[standard] >=0.12.0,<0.18.0",
"pre-commit >=2.17.0,<3.0.0",
]
all = [
"requests >=2.24.0,<3.0.0",

Loading…
Cancel
Save