fix(ci): satisfy lint for navigation changes
- commit
- 7e592a5acccc7af0cc775c920f1e674a257398ed
- author
- brice · · 2026-08-15 13:07 UTC
- parent
- c1deb9b
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +10 -5
M internal/bootstrap/development_environment.go +7 -4
| @@ -6,7 +6,10 @@ import ( | |||
| 6 | 6 | "path/filepath" | |
| 7 | 7 | ) | |
| 8 | 8 | ||
| 9 | - | const developmentEnvironmentName = "dev" | |
| 9 | + | const ( | |
| 10 | + | developmentEnvironmentName = "dev" | |
| 11 | + | developmentPrivateMode os.FileMode = 0o700 | |
| 12 | + | ) | |
| 10 | 13 | ||
| 11 | 14 | // ApplyDevelopmentEnvironment isolates the process from the user's XDG and | |
| 12 | 15 | // home directories when ENV=dev. It must run before GTK, CEF, or any adapter | |
| @@ -82,7 +85,7 @@ func developmentPrivateDirectories(root string, paths map[string]string) []strin | |||
| 82 | 85 | } | |
| 83 | 86 | ||
| 84 | 87 | func ensureDevelopmentDirectory(path string, private bool) error { | |
| 85 | - | if err := os.MkdirAll(path, 0o700); err != nil { | |
| 88 | + | if err := os.MkdirAll(path, developmentPrivateMode); err != nil { | |
| 86 | 89 | return fmt.Errorf("create development environment directory %q: %w", path, err) | |
| 87 | 90 | } | |
| 88 | 91 | ||
| @@ -96,14 +99,14 @@ func ensureDevelopmentDirectory(path string, private bool) error { | |||
| 96 | 99 | if !private { | |
| 97 | 100 | return nil | |
| 98 | 101 | } | |
| 99 | - | if err := os.Chmod(path, 0o700); err != nil { | |
| 102 | + | if err = os.Chmod(path, developmentPrivateMode); err != nil { | |
| 100 | 103 | return fmt.Errorf("restrict development environment directory %q: %w", path, err) | |
| 101 | 104 | } | |
| 102 | 105 | info, err = os.Stat(path) | |
| 103 | 106 | if err != nil { | |
| 104 | 107 | return fmt.Errorf("verify development environment directory %q: %w", path, err) | |
| 105 | 108 | } | |
| 106 | - | if info.Mode().Perm() != 0o700 { | |
| 109 | + | if info.Mode().Perm() != developmentPrivateMode.Perm() { | |
| 107 | 110 | return fmt.Errorf("development environment directory %q permissions are %04o, want 0700", path, info.Mode().Perm()) | |
| 108 | 111 | } | |
| 109 | 112 | return nil | |
| @@ -6,7 +6,10 @@ import ( | |||||
| 6 | "path/filepath" | 6 | "path/filepath" | ||
| 7 | ) | 7 | ) | ||
| 8 | 8 | ||||
| 9 | - | const developmentEnvironmentName = "dev" | 9 | + | const ( |
| 10 | + | developmentEnvironmentName = "dev" | |||
| 11 | + | developmentPrivateMode os.FileMode = 0o700 | |||
| 12 | + | ) | |||
| 10 | 13 | ||||
| 11 | // ApplyDevelopmentEnvironment isolates the process from the user's XDG and | 14 | // ApplyDevelopmentEnvironment isolates the process from the user's XDG and | ||
| 12 | // home directories when ENV=dev. It must run before GTK, CEF, or any adapter | 15 | // home directories when ENV=dev. It must run before GTK, CEF, or any adapter | ||
| @@ -82,7 +85,7 @@ func developmentPrivateDirectories(root string, paths map[string]string) []strin | |||||
| 82 | } | 85 | } | ||
| 83 | 86 | ||||
| 84 | func ensureDevelopmentDirectory(path string, private bool) error { | 87 | func ensureDevelopmentDirectory(path string, private bool) error { | ||
| 85 | - | if err := os.MkdirAll(path, 0o700); err != nil { | 88 | + | if err := os.MkdirAll(path, developmentPrivateMode); err != nil { |
| 86 | return fmt.Errorf("create development environment directory %q: %w", path, err) | 89 | return fmt.Errorf("create development environment directory %q: %w", path, err) | ||
| 87 | } | 90 | } | ||
| 88 | 91 | ||||
| @@ -96,14 +99,14 @@ func ensureDevelopmentDirectory(path string, private bool) error { | |||||
| 96 | if !private { | 99 | if !private { | ||
| 97 | return nil | 100 | return nil | ||
| 98 | } | 101 | } | ||
| 99 | - | if err := os.Chmod(path, 0o700); err != nil { | 102 | + | if err = os.Chmod(path, developmentPrivateMode); err != nil { |
| 100 | return fmt.Errorf("restrict development environment directory %q: %w", path, err) | 103 | return fmt.Errorf("restrict development environment directory %q: %w", path, err) | ||
| 101 | } | 104 | } | ||
| 102 | info, err = os.Stat(path) | 105 | info, err = os.Stat(path) | ||
| 103 | if err != nil { | 106 | if err != nil { | ||
| 104 | return fmt.Errorf("verify development environment directory %q: %w", path, err) | 107 | return fmt.Errorf("verify development environment directory %q: %w", path, err) | ||
| 105 | } | 108 | } | ||
| 106 | - | if info.Mode().Perm() != 0o700 { | 109 | + | if info.Mode().Perm() != developmentPrivateMode.Perm() { |
| 107 | return fmt.Errorf("development environment directory %q permissions are %04o, want 0700", path, info.Mode().Perm()) | 110 | return fmt.Errorf("development environment directory %q permissions are %04o, want 0700", path, info.Mode().Perm()) | ||
| 108 | } | 111 | } | ||
| 109 | return nil | 112 | return nil | ||
M internal/infrastructure/cef/semantic_navigation.go +3 -1
| @@ -76,7 +76,9 @@ func headingNavigationScript(direction, count int, highlightColor string) string | |||
| 76 | 76 | } | |
| 77 | 77 | // Refresh the outline on every navigation so an in-session accent change is | |
| 78 | 78 | // reflected even when the target style element already exists. | |
| 79 | - | style.textContent = "." + className + " { outline: 3px solid " + highlightColor + " !important; outline-offset: 5px !important; border-radius: 3px !important; }"; | |
| 79 | + | style.textContent = "." + className + | |
| 80 | + | " { outline: 3px solid " + highlightColor + | |
| 81 | + | " !important; outline-offset: 5px !important; border-radius: 3px !important; }"; | |
| 80 | 82 | window[stateKey] = target; | |
| 81 | 83 | target.classList.add(className); | |
| 82 | 84 | target.scrollIntoView({ block: "center", inline: "nearest", behavior: "smooth" }); | |
| @@ -76,7 +76,9 @@ func headingNavigationScript(direction, count int, highlightColor string) string | |||||
| 76 | } | 76 | } | ||
| 77 | // Refresh the outline on every navigation so an in-session accent change is | 77 | // Refresh the outline on every navigation so an in-session accent change is | ||
| 78 | // reflected even when the target style element already exists. | 78 | // reflected even when the target style element already exists. | ||
| 79 | - | style.textContent = "." + className + " { outline: 3px solid " + highlightColor + " !important; outline-offset: 5px !important; border-radius: 3px !important; }"; | 79 | + | style.textContent = "." + className + |
| 80 | + | " { outline: 3px solid " + highlightColor + | |||
| 81 | + | " !important; outline-offset: 5px !important; border-radius: 3px !important; }"; | |||
| 80 | window[stateKey] = target; | 82 | window[stateKey] = target; | ||
| 81 | target.classList.add(className); | 83 | target.classList.add(className); | ||
| 82 | target.scrollIntoView({ block: "center", inline: "nearest", behavior: "smooth" }); | 84 | target.scrollIntoView({ block: "center", inline: "nearest", behavior: "smooth" }); | ||