File tree Expand file tree Collapse file tree 9 files changed +58
-6
lines changed
Expand file tree Collapse file tree 9 files changed +58
-6
lines changed Original file line number Diff line number Diff line change 10571057 category : version-compat
10581058 fix : " Call window.set_maximize_flags(flags) then window.maximize()"
10591059 min-version : 49
1060+ guard-pattern : " get_maximized\\ s*\\ ?"
1061+ guard-window : 1
10601062
10611063- id : R-VER49-09
10621064 pattern : " \\ bAppMenuButton\\ b"
10841086 category : version-compat
10851087 min-version : 49
10861088 fix : " Call unmaximize() without the MaximizeFlags parameter"
1089+ guard-pattern : " get_maximized\\ s*\\ ?"
1090+ guard-window : 1
10871091
10881092# --- GNOME 50 migration (version-gated) ---
10891093# GNOME 50 removed X11 support and associated APIs.
Original file line number Diff line number Diff line change @@ -2230,7 +2230,8 @@ Rules for APIs removed or changed in specific GNOME Shell versions. These rules
22302230- ** Rule** : ` maximize()` lost the ` MaximizeFlags` parameter in GNOME 49.
22312231- ** Rationale** : Passing ` MaximizeFlags` to ` maximize()` will throw in GNOME 49.
22322232- ** Fix** : Call ` window.set_maximize_flags(flags)` first, then ` window.maximize()` .
2233- - ** Tested by** : ` tests/fixtures/gnome49-maximize@test/`
2233+ - ** Guard** : Suppressed when ` get_maximized ?` appears on the same line (ternary version- compat pattern).
2234+ - ** Tested by** : ` tests/fixtures/gnome49-compat@test/`
22342235
22352236### R - VER49 - 09 : AppMenuButton removal
22362237- ** Severity** : blocking
@@ -2556,6 +2557,7 @@ Rules for APIs removed or changed in specific GNOME Shell versions. These rules
25562557- **Rule**: ` MaximizeFlags` parameter was removed from ` unmaximize ()` in GNOME 49.
25572558- **Rationale**: The ` unmaximize ()` method no longer accepts a flags parameter.
25582559- **Fix**: Call ` unmaximize ()` without the ` MaximizeFlags` parameter.
2560+ - **Guard**: Suppressed when ` get_maximized ? ` appears on the same line (ternary version-compat pattern).
25592561
25602562---
25612563
Original file line number Diff line number Diff line change @@ -421,9 +421,12 @@ for f in "$EXT_DIR"/*.js; do
421421 continue
422422 fi
423423
424- # Check for any line > 500 chars (strong minification signal)
425- if awk ' length > 500 { found=1; exit } END { exit !found }' " $f " 2> /dev/null; then
426- minified_files+=" $rel_path (lines > 500 chars)" $' \n '
424+ # Check for lines > 500 chars — need 3+ such lines to flag as minified.
425+ # A single long line (e.g., keyboard constant chain) in an otherwise
426+ # readable file is not minification.
427+ long_line_count=$( awk ' length > 500 { n++ } END { print n+0 }' " $f " 2> /dev/null || true)
428+ if [[ " $long_line_count " -ge 3 ]]; then
429+ minified_files+=" $rel_path ($long_line_count lines > 500 chars)" $' \n '
427430 fi
428431done
429432if [[ -d " $EXT_DIR /lib" ]]; then
@@ -433,8 +436,9 @@ if [[ -d "$EXT_DIR/lib" ]]; then
433436 minified_files+=" $rel_path (webpack bundle)" $' \n '
434437 continue
435438 fi
436- if awk ' length > 500 { found=1; exit } END { exit !found }' " $f " 2> /dev/null; then
437- minified_files+=" $rel_path (lines > 500 chars)" $' \n '
439+ long_line_count=$( awk ' length > 500 { n++ } END { print n+0 }' " $f " 2> /dev/null || true)
440+ if [[ " $long_line_count " -ge 3 ]]; then
441+ minified_files+=" $rel_path ($long_line_count lines > 500 chars)" $' \n '
438442 fi
439443 done < <( find " $EXT_DIR /lib" -name ' *.js' -print0 2> /dev/null)
440444fi
Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ export default class Gnome49Test extends Extension {
99 this . _tap = new Clutter . TapAction ( ) ;
1010 }
1111
12+ // Ternary version-compat guard: should NOT trigger R-VER49-08/11
13+ _maximizeCompat ( window ) {
14+ window . get_maximized ? window . maximize ( Meta . MaximizeFlags . BOTH ) : window . maximize ( ) ;
15+ }
16+
17+ _unmaximizeCompat ( window ) {
18+ window . get_maximized ? window . unmaximize ( Meta . MaximizeFlags . BOTH ) : window . unmaximize ( ) ;
19+ }
20+
1221 disable ( ) {
1322 this . _click = null ;
1423 this . _tap = null ;
Original file line number Diff line number Diff line change 1+ SPDX-License-Identifier: GPL-2.0-or-later
Original file line number Diff line number Diff line change 1+ {
2+ "uuid" : " minified-boundary@test" ,
3+ "name" : " Minified Boundary Test" ,
4+ "description" : " Tests that 2 long lines do not trigger minified-js detection" ,
5+ "shell-version" : [" 48" ],
6+ "url" : " https://example.com"
7+ }
Original file line number Diff line number Diff line change @@ -191,6 +191,12 @@ assert_exit_code "exits with 1 (has failures)" 1
191191assert_output_contains " fails on minified JS" " \[FAIL\].*minified-js"
192192echo " "
193193
194+ # --- minified-boundary (2 long lines — below threshold) ---
195+ echo " === minified-boundary ==="
196+ run_lint " minified-boundary@test"
197+ assert_output_not_contains " no minified-js with only 2 long lines" " \[FAIL\].*minified-js"
198+ echo " "
199+
194200# --- init-time-safety ---
195201echo " === init-time-safety ==="
196202run_lint " init-time-safety@test"
@@ -428,6 +434,8 @@ assert_exit_code "exits with 1 (has failures)" 1
428434assert_output_contains " fails on Meta.Rectangle" " \[FAIL\].*R-VER49-01"
429435assert_output_contains " fails on Clutter.ClickAction" " \[FAIL\].*R-VER49-02"
430436assert_output_contains " fails on Clutter.TapAction" " \[FAIL\].*R-VER49-03"
437+ assert_output_not_contains " no R-VER49-08 with ternary guard" " \[FAIL\].*R-VER49-08"
438+ assert_output_not_contains " no R-VER49-11 with ternary guard" " \[FAIL\].*R-VER49-11"
431439echo " "
432440
433441# --- gnome46-extras ---
You can’t perform that action at this time.
0 commit comments