summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorSamuel Thibault <sthibault@hypra.fr>2018-03-12 18:28:06 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-03-27 14:46:32 +0200
commitd0f1a431eab9a7a503bf6487732eeaec0e881053 (patch)
treeb86bdfe13591cd653196e3f3970450eed6d17c60 /solenv
parent8766bb000afceb4a070ef310b939f7250e5c3a8a (diff)
gla11y: update heuristics but don't enable warnings yet
This updates gla11y with all heuristics to detect orphan labels and widgets without too many false positives. This updates gbuild to tell gla11y to only emit errors about undefined targets and about orphan warnings for GtkScale (as was the case with previous versions). More errors and warnings will be enabled progressively later on. Change-Id: I96580eb0eb8eb327f0f54563d7976a5148e9531a Reviewed-on: https://gerrit.libreoffice.org/51161 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/UIConfig.mk67
-rw-r--r--solenv/gbuild/platform/com_GCC_class.mk2
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk2
-rw-r--r--solenv/sanitizers/ui/cui.suppr11
-rw-r--r--solenv/sanitizers/ui/svt.suppr4
-rw-r--r--solenv/sanitizers/ui/svx.suppr18
6 files changed, 90 insertions, 14 deletions
diff --git a/solenv/gbuild/UIConfig.mk b/solenv/gbuild/UIConfig.mk
index 9a88ffd44498..fb3d82d0b912 100644
--- a/solenv/gbuild/UIConfig.mk
+++ b/solenv/gbuild/UIConfig.mk
@@ -125,11 +125,76 @@ $(call gb_UIConfig_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),UIA,2)
rm -f $(call gb_UIConfig_get_a11yerrors_target,$*)
+gb_UIConfig_gla11y_PARAMETERS = -P $(SRCDIR)/
+
+# Disable this to see suppressed warnings
+ifeq (1,1)
+gb_UIConfig_gla11y_PARAMETERS += -s $(UI_A11YSUPPRS)
+endif
# Enable this to regenerate suppression files
ifeq (1,0)
-GEN_A11Y_SUPPRS = -g $(UI_A11YSUPPRS)
+gb_UIConfig_gla11y_PARAMETERS += -g $(UI_A11YSUPPRS)
endif
+# Tell gla11y about LO-specific widgets
+# These are already automatically labelled Shrink/Expand
+gb_UIConfig_gla11y_PARAMETERS += --widgets-ignored +foruilo-RefButton
+# These, however, do need a label like a GtkEntry
+gb_UIConfig_gla11y_PARAMETERS += --widgets-needlabel +foruilo-RefEdit
+# These are storage, containers, or preview
+gb_UIConfig_gla11y_PARAMETERS += --widgets-suffixignored +ValueSet,HBox,VBox,ToolBox,Preview,PreviewWin,PreviewWindow,PrevWindow
+# These are buttons, thus already contain their label (but an image is not enough)
+gb_UIConfig_gla11y_PARAMETERS += --widgets-button +vcllo-SmallButton,cuilo-RubyRadioButton,chartcontrollerlo-LightButton,svtlo-ManagedMenuButton
+
+# All new warnings should be fatal except a few kinds which could be only doubtful
+gb_UIConfig_gla11y_PARAMETERS += --fatal-all --not-fatal-type duplicate-mnemonic --not-fatal-type labelled-by-and-mnemonic --not-fatal-type orphan-label
+
+# Disable all warnings types by default for now, to enable warnings types progressively
+gb_UIConfig_gla11y_PARAMETERS += --disable-all
+
+# For now, ignore orphan labels without an unlabelled widget
+gb_UIConfig_gla11y_PARAMETERS += --disable-orphan-labels
+# but do not ignore orphan labels with an unlabelled widget
+gb_UIConfig_gla11y_PARAMETERS += --enable-type orphan-label
+
+# The following are to be uncommented progressively
+
+# These are definite errors
+gb_UIConfig_gla11y_PARAMETERS += --enable-type undeclared-target
+#gb_UIConfig_gla11y_PARAMETERS += --enable-type missing-label-for
+#gb_UIConfig_gla11y_PARAMETERS += --enable-type missing-labelled-by
+
+# These are often buttons with only an image
+#gb_UIConfig_gla11y_PARAMETERS += --enable-type button-no-label
+# These are often doubtful
+#gb_UIConfig_gla11y_PARAMETERS += --enable-type duplicate-mnemonic --enable-type labelled-by-and-mnemonic
+
+# For now, disable warning about widgets without a label by default, to enable warnings for classes progressively
+# To be uncommented progressively
+gb_UIConfig_gla11y_PARAMETERS += --disable-type no-labelled-by
+# Clearly need labelling
+gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkScale
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkEntry
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkSpinButton
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkSpinner
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkProgressBar
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.svxcorelo-SvxColorListBox
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.svxcorelo-SvxLanguageBox
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.sfxlo-SvxCharView
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.foruilo-RefEdit
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.svxcorelo-PaperSizeListBox
+# Probably need labelling
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkComboBox
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkComboBoxText
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkMenuItem
+# Possibly need labelling
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkTreeView
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkTreeViewColumn
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkTextView
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkDrawingArea
+# Perhaps need labelling
+#gb_UIConfig_gla11y_PARAMETERS += --enable-specific no-labelled-by.GtkImage
+
define gb_UIConfig_a11yerrors__command
$(call gb_Output_announce,$(2),$(true),UIA,1)
$(call gb_UIConfig__gla11y_command)
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index 6d5393d2fad9..4c3531934d5e 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -159,7 +159,7 @@ define gb_UIConfig__gla11y_command
$(call gb_Helper_abbreviate_dirs,\
$(gb_UIConfig_LXML_PATH) $(gb_Helper_set_ld_path) \
$(call gb_ExternalExecutable_get_command,python) \
- $(gb_UIConfig_gla11y_SCRIPT) -s $(UI_A11YSUPPRS) $(GEN_A11Y_SUPPRS) -P $(SRCDIR)/ -o $@ $(UIFILES)
+ $(gb_UIConfig_gla11y_SCRIPT) $(gb_UIConfig_gla11y_PARAMETERS) -o $@ $(UIFILES)
)
endef
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 0a1cdab314ac..8c0a23e9bf03 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -583,7 +583,7 @@ $(call gb_Helper_abbreviate_dirs,\
FILES=$(call var2file,$(shell $(gb_MKTEMP)),100,$(UIFILES)) && \
$(gb_UIConfig_LXML_PATH) $(gb_Helper_set_ld_path) \
$(call gb_ExternalExecutable_get_command,python) \
- $(gb_UIConfig_gla11y_SCRIPT) -s $(UI_A11YSUPPRS) $(GEN_A11Y_SUPPRS) -P $(SRCDIR)/ -o $@ -L $$FILES
+ $(gb_UIConfig_gla11y_SCRIPT) $(gb_UIConfig_gla11y_PARAMETERS) -o $@ -L $$FILES
)
endef
diff --git a/solenv/sanitizers/ui/cui.suppr b/solenv/sanitizers/ui/cui.suppr
index d9e0294f464f..598c7a600ae3 100644
--- a/solenv/sanitizers/ui/cui.suppr
+++ b/solenv/sanitizers/ui/cui.suppr
@@ -1,3 +1,8 @@
-cui/uiconfig/ui/gradientpage.ui:GtkBox[@id='GradientPage']/GtkFrame[@id='frame1']/GtkAlignment[@id='alignment1']/GtkBox[@id='box2']/GtkGrid[@id='grid6']/GtkScale[@id='incrementslider'] no-labelled-by
-cui/uiconfig/ui/gradientpage.ui:GtkBox[@id='GradientPage']/GtkFrame[@id='frame1']/GtkAlignment[@id='alignment1']/GtkBox[@id='box2']/GtkGrid[@id='grid3']/GtkScale[@id='borderslider'] no-labelled-by
-cui/uiconfig/ui/hatchpage.ui:GtkBox[@id='HatchPage']/GtkFrame[@id='frame1']/GtkAlignment[@id='alignment1']/GtkBox[@id='box3']/GtkBox[@id='box1']/GtkScale[@id='angleslider'] no-labelled-by
+cui/uiconfig/ui/gradientpage.ui://GtkScale[@id='incrementslider'] no-labelled-by
+cui/uiconfig/ui/gradientpage.ui://GtkLabel[@id='centerft'] orphan-label
+cui/uiconfig/ui/gradientpage.ui://GtkScale[@id='borderslider'] no-labelled-by
+cui/uiconfig/ui/hatchpage.ui://GtkLabel[@id='distanceft'] orphan-label
+cui/uiconfig/ui/hatchpage.ui://GtkLabel[@id='angleft'] orphan-label
+cui/uiconfig/ui/hatchpage.ui://GtkScale[@id='angleslider'] no-labelled-by
+cui/uiconfig/ui/hatchpage.ui://GtkLabel[@id='linetypeft'] orphan-label
+cui/uiconfig/ui/hatchpage.ui://GtkLabel[@id='linecolorft'] orphan-label
diff --git a/solenv/sanitizers/ui/svt.suppr b/solenv/sanitizers/ui/svt.suppr
index 40ba68b7b93a..64325dcb38dd 100644
--- a/solenv/sanitizers/ui/svt.suppr
+++ b/solenv/sanitizers/ui/svt.suppr
@@ -1,2 +1,2 @@
-svtools/uiconfig/ui/graphicexport.ui:GtkDialog[@id='GraphicExportDialog']/GtkBox[@id='dialog-vbox1']/GtkBox[@id='box1']/GtkFrame[@id='jpgquality']/GtkAlignment[@id='alignment5']/GtkGrid[@id='grid2']/GtkScale[@id='compressionjpgsb'] no-labelled-by
-svtools/uiconfig/ui/graphicexport.ui:GtkDialog[@id='GraphicExportDialog']/GtkBox[@id='dialog-vbox1']/GtkBox[@id='box1']/GtkFrame[@id='pngcompression']/GtkAlignment[@id='alignment13']/GtkGrid[@id='grid9']/GtkScale[@id='compressionpngsb'] no-labelled-by
+svtools/uiconfig/ui/graphicexport.ui://GtkScale[@id='compressionjpgsb'] no-labelled-by
+svtools/uiconfig/ui/graphicexport.ui://GtkScale[@id='compressionpngsb'] no-labelled-by
diff --git a/solenv/sanitizers/ui/svx.suppr b/solenv/sanitizers/ui/svx.suppr
index 9179abb2dbd5..b9babb1171ab 100644
--- a/solenv/sanitizers/ui/svx.suppr
+++ b/solenv/sanitizers/ui/svx.suppr
@@ -1,6 +1,12 @@
-svx/uiconfig/ui/compressgraphicdialog.ui:GtkDialog[@id='CompressGraphicDialog']/GtkBox[@id='dialog-vbox1']/GtkGrid/GtkFrame[@id='frame2']/GtkAlignment[@id='alignment1']/GtkGrid[@id='grid2']/GtkAlignment/GtkGrid/GtkScale[@id='scale-quality'] no-labelled-by
-svx/uiconfig/ui/compressgraphicdialog.ui:GtkDialog[@id='CompressGraphicDialog']/GtkBox[@id='dialog-vbox1']/GtkGrid/GtkFrame[@id='frame2']/GtkAlignment[@id='alignment1']/GtkGrid[@id='grid2']/GtkAlignment/GtkGrid/GtkScale[@id='scale-compression'] no-labelled-by
-svx/uiconfig/ui/mediaplayback.ui:GtkGrid[@id='MediaPlaybackPanel']/GtkGrid[@id='grid1']/GtkScale[@id='timeslider'] no-labelled-by
-svx/uiconfig/ui/mediaplayback.ui:GtkGrid[@id='MediaPlaybackPanel']/GtkGrid[@id='grid1']/GtkScale[@id='volumeslider'] no-labelled-by
-svx/uiconfig/ui/sidebararea.ui:GtkGrid[@id='AreaPropertyPanel']/GtkBox[@id='box1']/GtkGrid[@id='grid1']/GtkScale[@id='transparencyslider'] no-labelled-by
-svx/uiconfig/ui/sidebarshadow.ui:GtkGrid[@id='ShadowPropertyPanel']/GtkGrid[@id='grid3']/GtkBox[@id='box2']/GtkBox[@id='box1']/GtkGrid[@id='grid2']/GtkScale[@id='transparency_slider'] no-labelled-by
+svx/uiconfig/ui/compressgraphicdialog.ui://GtkScale[@id='scale-quality'] no-labelled-by
+svx/uiconfig/ui/compressgraphicdialog.ui://GtkScale[@id='scale-compression'] no-labelled-by
+svx/uiconfig/ui/mediaplayback.ui://GtkLabel[@id='label1'] orphan-label
+svx/uiconfig/ui/mediaplayback.ui://GtkLabel[@id='label2'] orphan-label
+svx/uiconfig/ui/mediaplayback.ui://GtkLabel[@id='label3'] orphan-label
+svx/uiconfig/ui/mediaplayback.ui://GtkScale[@id='timeslider'] no-labelled-by
+svx/uiconfig/ui/mediaplayback.ui://GtkScale[@id='volumeslider'] no-labelled-by
+svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='angle'] orphan-label
+svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='distance'] orphan-label
+svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='transparency_label'] orphan-label
+svx/uiconfig/ui/sidebarshadow.ui://GtkScale[@id='transparency_slider'] no-labelled-by
+svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='color'] orphan-label