Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section to linter docs about disabling linters #728

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/LINTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,25 @@ To handle these cases, we use the convention that subpackages ending in `-compat
To encourage this convention, we have a linter that will fail if a package builds components into locations that are likely to be for upstream compatibility, where the package is not named like `-compat`.

When a linter finds an issue, you should normally have the main package install into `/usr/bin`, and have a `-compat` subpackage that moves or symlinks the files into the expected location outside of the normal location.

### Disabling lints

When a lint fails, it is sending a clear signal that something is wrong. Therefore, ints should only be disabled after discussion with other team members ensuring it is in fact the right thing to do.
Elizafox marked this conversation as resolved.
Show resolved Hide resolved

When in doubt, assume the linter is correct, and a true problem exists. Follow the guidance given by the lint diagnostic to fix it.

When disabling a lint, a justification should be provided in the form of a comment, to help other maintainers.

To disable a lint, use something similar to the following configuration:

```yaml
package:
name: foobar
version: 1.0.0
epoch: 42
checks:
disable:
- setuidgid # Package is meant to have setuid binaries
debug # Toolchain problems require we keep debug info
...
```
Loading