Support custom failure settings
- Dominant language
- Haskell
- Stars
- 597
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Proposed here: https://github.com/kowainik/stan/issues/44#issuecomment-640856753
We want to implement an ability to specify when Stan should exit with non-zero code. This is useful for running Stan on CI. But since different projects have different settings and requirements, we want to provide a flexible solution. We consider the following use-cases:
1. Fail if any observation has specified severity (e.g. `Warning`) or higher.
2. Fail if any observation is from particular category (e.g. AntiPattern).
3. Fail on particular inspection ID (e.g. STAN-0206).
4. Fail on any inspection in a particular file or directory (which is supposed to be super-safe).
5. Fail if health threshold is less than a given number.
6. Fail if unknown observations are ignored.
TOML example covering all the above use-cases looks like this:
```toml
[[fail]]
severity = "Warning"
scope = "all"
[[fail]]
category = "AntiPattern"
scope = "all"
[[fail]]
id = "STAN-0206"
scope = "all"
[[fail]]
filter = "all"
file = "src/Super/Safe/API.hs"
[[fail]]
health = 95 # fail if health < 95%
```
Contributor guide
Research direction
Start with the linked proposal in issue #44 and compare it with the six use cases and TOML examples in this issue. Done means Stan supports configurable non-zero exit conditions for the listed severity, category, inspection ID, file or directory, health threshold, and unknown-observation cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100