An open API service indexing awesome lists of open source software.

https://github.com/kaliv0/detox-jar

Command line automation tool
https://github.com/kaliv0/detox-jar

automation cli python-automation tool

Last synced: 4 months ago
JSON representation

Command line automation tool

Awesome Lists containing this project

README

          


Detox jar

# Detox jar

![Python 3.x](https://img.shields.io/badge/python-3.11-blue?style=flat-square&logo=Python&logoColor=white)
[![PyPI](https://img.shields.io/pypi/v/detox-jar.svg)](https://pypi.org/project/detox-jar/)
[![Downloads](https://static.pepy.tech/badge/detox-jar)](https://pepy.tech/projects/detox-jar)


Command line automation tool in pure Python

---------------------------
### How to use
- Describe jobs as tables/dictionaries in a config file called 'detox' (choose between .toml, .yaml or .json format).

(Put the config inside the root directory of your project)
```toml
# detox.toml
[test]
description = "test project"
dependencies = ["pytest", "pytest-cov"]
commands = "pytest -vv --disable-warnings -s --cache-clear"
```
```yaml
# detox.yaml
test:
description: test project
dependencies:
- pytest
- pytest-cov
commands:
- pytest -vv --disable-warnings -s --cache-clear
```

- description and dependencies could be optional but not commands
```toml
# detox.toml
[no-deps]
commands = "echo 'Hello world'"
```
(in json)
```json
"no-deps": {
"commands": "echo 'Hello world'"
}
```

- dependencies and commands could be strings or (in case of more than one) a list of strings
```toml
# detox.toml
commands = ["ruff check --fix", "ruff format --line-length=100 ."]
```
```yaml
# detox.yaml
commands:
- ruff check --fix
- ruff format --line-length=100 .
```

- You could provide a [run] table inside the config file with a 'suite' - list of selected jobs to run
```toml
[run]
suite = ["lint", "format", "test"]
```
```json
"run": {
"suite": [
"lint",
"format",
"test",
"no-deps"
]
}
```
---------------------------
- Run the tool in the terminal with a simple 'detox' command
```shell
$ detox
```
```shell
(logs omitted...)
$ All jobs succeeded! ['lint', 'format', 'test']
Detoxing took: 14.088007061000098
```
- In case of failing jobs you get general stats
```shell
(logs omitted...)
$ Unsuccessful detoxing took: 13.532951637999759
Failed jobs: ['format']
Successful jobs: ['lint', 'test']
```
or
```shell
$ Unsuccessful detoxing took: 8.48367640699962
Failed jobs: ['format']
Successful jobs: ['lint']
Skipped jobs: ['test']
```
---------------------------
- You could run specific jobs in the command line
```shell
$ detox -j lint
```
or a list of jobs
```shell
$ detox -j lint format
```
NB: If there is a 'run' table in the config file the jobs specified in the command line take precedence