From 9ca7222ba54ba44b2835c405c5fbfe31b826046e Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Fri, 7 Feb 2025 08:15:56 -0800 Subject: [PATCH] Address PR comments --- pkg/accessibility/accessibility.go | 6 +++++- pkg/accessibility/accessibility_test.go | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/accessibility/accessibility.go b/pkg/accessibility/accessibility.go index f97bd53..e50a478 100644 --- a/pkg/accessibility/accessibility.go +++ b/pkg/accessibility/accessibility.go @@ -6,7 +6,11 @@ import ( "github.com/cli/go-gh/v2/pkg/config" ) -const ACCESSIBILITY_ENV = "ACCESSIBILITY" +// ACCESSIBILITY_ENV is the name of the environment variable that can be used to enable +// accessibility features. If the value is empty, "0", or "false", the accessibility +// features are disabled. Any other value enables the accessibility features. Note that +// this environment variable supercedes the configuration file's accessible setting. +const ACCESSIBILITY_ENV = "GH_ACCESSIBILE" // IsEnabled returns true if accessibility features are enabled via the ACCESSIBILITY // environment variable or the configuration file. diff --git a/pkg/accessibility/accessibility_test.go b/pkg/accessibility/accessibility_test.go index 55470e6..a00a370 100644 --- a/pkg/accessibility/accessibility_test.go +++ b/pkg/accessibility/accessibility_test.go @@ -34,7 +34,7 @@ func TestIsEnabled(t *testing.T) { }, { name: "When the accessibility configuration is unset and the ACCESSIBLE env var returns 'false', it should return false", - envVarValue: "0", + envVarValue: "false", cfgStr: "", wantOut: false, }, @@ -58,7 +58,7 @@ func TestIsEnabled(t *testing.T) { }, { name: "When the accessibility configuration is set to enabled and the env var is set to '0', it should return false", - envVarValue: "false", + envVarValue: "0", cfgStr: accessibilityEnabledConfig(), wantOut: false, },