Automattic / Automattic/harper

Need support for mutually exclusive / multi-way settings

Open
#2,396 2 comments 0 reactions 0 assignees View on GitHub
config-options-prefs-settings enhancement harper-core help wanted linting question
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
102

Description

**What problem does this solve?**

Currently a rule can only be enabled or disabled.
But some rules come in pairs: [`OxfordComma`](harper-core/src/linting/oxford_comma.rs) / [`NoOxfordComma`](harper-core/src/linting/no_oxford_comma.rs)

Others in PR or draft PR aim to allow the user to prefer one side or another:
- https://github.com/Automattic/harper/pull/2209

Or a three-way choice between preferring one vs the other vs not caring:
- https://github.com/Automattic/harper/pull/2384

**Proposed Solution**

There's a small discussion: https://github.com/Automattic/harper/discussions/2208
But more is needed.
- An extension to `LintGroup`?
- One or more additional kinds of group besides `LintGroup`?
- Additions to the config/settings/prefs that provide a place for the user to choose.

**Component**
- [x] Core engine
- [ ] Plugin/Extension
- [ ] Other: _____

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked discussion and the existing OxfordComma and NoOxfordComma implementations in harper-core/src/linting/oxford_comma.rs and harper-core/src/linting/no_oxford_comma.rs. Review PRs 2209 and 2384, then define how LintGroup or another grouping mechanism and the config/settings/prefs should represent mutually exclusive choices, with those preference scenarios supported as the completion criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.