6 Star 14 Fork 11

Gitee 极速下载/streamlit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/streamlit/streamlit
克隆/下载
.pre-commit-config.yaml 7.62 KB
一键复制 编辑 原始数据 按行查看 历史
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Pre-commit configuration file,
# when Streamlit's pre-commit detects that one of the linters has failed,
# it automatically lints the files and does not allow the commit to pass.
# Please review the changes after lint has failed and commit them again,
# the second commit should pass,
# because the files were linted after trying to do the first commit.
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# We fix ruff to a version to be in sync with the dev-requirements:
rev: v0.11.12
hooks:
# Run the linter.
- id: ruff
args: [--fix]
files: \.py$|\.pyi$
# Run the formatter.
- id: ruff-format
files: \.py$|\.pyi$
- repo: local
hooks:
# Script ./scripts/run_in_subdirectory.py was used to work around a
# known problem with hooks in subdirectories when pass_filenames option
# is set to true
# See: https://github.com/pre-commit/pre-commit/issues/1417
- id: prettier-app
name: Prettier App
# NOTE: This hook currently does not work on Windows due to "yarn" not being an executable and win32api.CreateProcess
# turning `subprocess.run(["yarn", "prettier", "--write"])` into a call to `yarn.exe prettier --write` which does not exist
entry: ./scripts/run_in_subdirectory.py frontend/app yarn run format
files: ^frontend/app/.*\.(js|jsx|ts|tsx)$
exclude: /vendor/
language: node
pass_filenames: true
- id: prettier-lib
name: Prettier Lib
# NOTE: This hook currently does not work on Windows due to "yarn" not being an executable and win32api.CreateProcess
# turning `subprocess.run(["yarn", "prettier", "--write"])` into a call to `yarn.exe prettier --write` which does not exist
entry: ./scripts/run_in_subdirectory.py frontend/lib yarn run format
files: ^frontend/lib/.*\.(js|jsx|ts|tsx)$
exclude: /vendor/
language: node
pass_filenames: true
- id: prettier-connection
name: Prettier Connection
# NOTE: This hook currently does not work on Windows due to "yarn" not being an executable and win32api.CreateProcess
# turning `subprocess.run(["yarn", "prettier", "--write"])` into a call to `yarn.exe prettier --write` which does not exist
entry: ./scripts/run_in_subdirectory.py frontend/connection yarn run format
files: ^frontend/connection/.*\.(js|jsx|ts|tsx)$
exclude: /vendor/
language: node
pass_filenames: true
- id: prettier-utils
name: Prettier Utils
# NOTE: This hook currently does not work on Windows due to "yarn" not being an executable and win32api.CreateProcess
# turning `subprocess.run(["yarn", "prettier", "--write"])` into a call to `yarn.exe prettier --write` which does not exist
entry: ./scripts/run_in_subdirectory.py frontend/utils yarn run format
files: ^frontend/utils/.*\.(js|jsx|ts|tsx)$
exclude: /vendor/
language: node
pass_filenames: true
- id: prettier-yaml
name: Prettier-yaml
# NOTE: This hook currently does not work on Windows due to "yarn" not being an executable and win32api.CreateProcess
# turning `subprocess.run(["yarn", "prettier", "--write"])` into a call to `yarn.exe prettier --write` which does not exist
# We perform this in the app directory because prettier is installed there. TODO: Break this out to a new package
entry: ./scripts/run_in_subdirectory.py frontend/app yarn prettier ../../.github --write
files: ^.github/.*\.(yml|yaml)$
language: node
pass_filenames: false
- id: license-headers
name: Checks that all files have the required license headers
entry: ./scripts/check_license_headers.py
language: system
always_run: true
pass_filenames: false
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: Add license for all (S)CSS/JS(X)/TS(X) files
files: \.(s?css|jsx?|tsx?)$
args:
- --comment-style
- "/**| *| */"
- --license-filepath
- scripts/assets/license-template.txt
- --fuzzy-match-generates-todo
exclude: |
(?x)
/vendor/
|^vendor/
|^component-lib/declarations/apache-arrow
|^frontend/app/src/assets/css/variables\.scss
|^lib/tests/streamlit/elements/test_html\.js
|^lib/tests/streamlit/elements/test_html\.css
|^e2e_playwright/test_assets/
- id: insert-license
name: Add license for all Proto files
files: \.proto$
args:
- --comment-style
- "/**!| *| */"
- --license-filepath
- scripts/assets/license-template.txt
- --fuzzy-match-generates-todo
exclude: |
(?x)
/vendor/
|^vendor/
|^component-lib/declarations/apache-arrow
|^proto/streamlit/proto/openmetrics_data_model\.proto
- id: insert-license
name: Add license for all shell files
files: \.sh$
args:
- --comment-style
- "|#|"
- --license-filepath
- scripts/assets/license-template.txt
- --fuzzy-match-generates-todo
exclude: |
(?x)
/vendor/
|^vendor/
|^component-lib/declarations/apache-arrow
- id: insert-license
name: Add license for all Python files
files: \.py$|\.pyi$
args:
- --comment-style
- "|#|"
- --license-filepath
- scripts/assets/license-template.txt
- --fuzzy-match-generates-todo
exclude: |
(?x)
/vendor/
|^vendor/
|^component-lib/declarations/apache-arrow
- id: insert-license
name: Add license for all HTML files
files: \.html$
args:
- --comment-style
- "<!--||-->"
- --license-filepath
- scripts/assets/license-template.txt
- --fuzzy-match-generates-todo
exclude: |
(?x)
/vendor/
|^vendor/
|^component-lib/declarations/apache-arrow
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: |
(?x)
^frontend/app/src/assets/
|^NOTICES$
|^proto/streamlit/proto/openmetrics_data_model.proto$
|\.snap$
- id: check-added-large-files
- id: check-json
exclude: .vscode/launch.json
- id: check-toml
- id: check-yaml
exclude: lib/conda-recipe/meta.yaml
- id: check-symlinks
- id: check-case-conflict
- id: check-merge-conflict
- id: fix-byte-order-marker
- id: end-of-file-fixer
exclude: |
(?x)
/vendor/
|^NOTICES$
|^e2e_playwright/test_assets/
|^LICENSE$
- id: mixed-line-ending
args: [--fix=lf]
exclude: |
(?x)
^NOTICES$
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mirrors/streamlit.git
git@gitee.com:mirrors/streamlit.git
mirrors
streamlit
streamlit
develop

搜索帮助