在预提交钩子中获得Thoth推荐。
项目描述
Thoth预提交钩子
使用Thoth预提交钩子获取对您的依赖项的Thoth建议。
用法
在.pre-commit-config.yaml
中的示例用法
---
repos:
- repo: https://github.com/thoth-station/thoth-pre-commit-hook
rev: v0.1.2
hooks:
- id: thoth-pre-commit-hook
args: ["--recommendation-type", "security"]
可以通过运行Thamos(与Thoth后端通信的命令行界面)来找到可以指定的参数列表
Usage: thamos advise [OPTIONS]
Ask Thoth for recommendations on the application stack.
Ask the remote Thoth service for advise on the application stack used. The command collects information stated in the .thoth.yaml file for the given runtime
environment, static source code analysis and requirements for the application and sends them to the remote service. Optionally, install packages resolved by Thoth.
Examples:
thamos advise --runtime-environment testing --labels 'foo=bar,qux=baz'
thamos advise --dev
thamos advise --install
thamos advise --no-static-analysis --no-user-stack
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --debug Run analysis in debug mode on Thoth. │
│ --no-write -W Do not write results to files, just print them. │
│ --recommendation-type -t RECOMMENDATION_TYPE Use selected recommendation type, do not load it from Thoth's config file. │
│ --no-wait Do not wait for analysis to finish, just submit it. │
│ --no-user-stack Do not submit lock file with the request, this lock file is normally used as a base for │
│ comparision to recommend a better stack than the one used. │
│ --no-static-analysis Do not perform static analysis of source code files. │
│ --json -j Print output in JSON format. │
│ --force Force analysis run bypassing server-side cache. │
│ --runtime-environment -r NAME Specify explicitly runtime environment to get recommendations for; defaults to the first entry in │
│ the configuration file. │
│ --dev Consider or do not consider development dependencies during the resolution. [default: no-dev] │
│ --install Install dependencies once the advise is done. [default: False] │
│ --write-advised-manifest-changes FILE Write advised manifest changes to a file. │
│ --labels -l KEY1=VALUE1,KEY2=VALUE2 Labels used to label the request. │
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Check Thamos documentation: https://thoth-station.ninja/docs/developers/thamos
-
recommendation-type
:用于依赖项解决的Thoth建议类型。可用的建议类型包括security
stable
latest
performance
testing
有关更多详细信息,请参阅建议类型文档。
-
runtime-environment
:用于依赖项分析的运行时环境。Thoth可以对不同的运行时环境分析您的依赖项ubi-8-py-3.8
rhel-8-py-3.8
fedora-35-py-3.10
fedora-34-py-3.9
要运行此预提交钩子,必须按照Thamos CLI文档中指定的方式配置仓库,并包含一个.thoth.yaml
文件。Thoth预提交钩子在解决后会在依赖项要求文件目录中生成一个.thoth_last_analysis_id
文件。为了避免提交它,请将其添加到您的仓库.gitignore
文件中。
项目详情
关闭
哈希值 for thoth_pre_commit_hook-0.1.3-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c6ba27eae2ecabab424946ab275e023d703af16fe36dc46889ef2567ae6287be |
|
MD5 | 95674332a01f127a9eefd242690576c7 |
|
BLAKE2b-256 | 7a31d6d78f3858787b87051671488eeecc662cf62c4820ce443f1b981fce45e9 |