Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mayaCostantini committed Jun 23, 2022
1 parent 54c2bc3 commit bbc9da2
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Thoth pre-commit hooks
# Thoth pre-commit hook

Get Thoth advise on your dependencies with the Thoth pre-commit hook.

## Usage

In `.pre-commit-config.yaml`:
Example usage in `.pre-commit-config.yaml`:

```
---
Expand All @@ -12,3 +14,41 @@ repos:
- id: thoth-advise
args: ["--recommendation-type", "security"]
```

The list of arguments that can be specified can be found by running [Thamos](https://pypi.org/project/thamos/), the command line interface to communicate with Thoth's backend:

```
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
```

To be able to run this pre-commit hook, the repository must be configured with a `.thoth.yaml` file as specified in the [Thamos CLI documentation](https://github.com/thoth-station/thamos#using-custom-configuration-file-template).

0 comments on commit bbc9da2

Please sign in to comment.