From 197e30c5b1726e5ab7b968ab42e9989ac8ccbb80 Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Thu, 28 Sep 2023 18:42:07 -0400 Subject: [PATCH 1/2] Document disabling lints and when to do so. Signed-off-by: Elizabeth Myers --- docs/LINTER.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/LINTER.md b/docs/LINTER.md index 67c57a0a4..6d9bbb161 100644 --- a/docs/LINTER.md +++ b/docs/LINTER.md @@ -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. + +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 + ... +``` From 4e79088d7457c940db6e6cf82287ff599c31820d Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Fri, 29 Sep 2023 16:07:02 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Jason Hall Signed-off-by: Elizabeth Myers --- docs/LINTER.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LINTER.md b/docs/LINTER.md index 6d9bbb161..b6df8ce9a 100644 --- a/docs/LINTER.md +++ b/docs/LINTER.md @@ -29,7 +29,7 @@ When a linter finds an issue, you should normally have the main package install ### 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. +When a lint fails, it is sending a clear signal that something is wrong. Therefore, lints should only be disabled after discussion with other team members ensuring it is in fact the right thing to do. When in doubt, assume the linter is correct, and a true problem exists. Follow the guidance given by the lint diagnostic to fix it.