D22371: Run clang-tidy with modernize-use-override check

Vlad Zagorodniy noreply at phabricator.kde.org
Wed Jul 10 11:52:12 BST 2019


zzag created this revision.
zzag added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
zzag requested review of this revision.

REVISION SUMMARY
  Currently code base of kwin can be viewed as two pieces. One is very
  ancient, and the other one is more modern, which uses new C++ features.
  
  The main problem with the ancient code is that it was written before
  C++11 era. So, no override or final keywords, lambdas, etc.
  
  Quite recently, KDE compiler settings were changed to show a warning if
  a virtual method has missing override keyword. As you might have already
  guessed, this fired back at us because of that ancient code. We had
  about 500 new compiler warnings.
  
  A "solution" was proposed to that problem - disable -Wno-suggest-override
  and the other similar warning for clang. It's hard to call a solution
  because those warnings are disabled not only for the old code, but also
  for new. This is not what we want!
  
  The main argument for not actually fixing the problem was that git
  history will be screwed as well because of human factor. While good git
  history is a very important thing, we should not go crazy about it and
  block every change that somehow alters git history. git blame allows to
  specify starting revision for a reason.
  
  The other argument (human factor) can be easily solved by using tools
  such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
  be used for various things, e.g. fixing coding styles(e.g. add missing
  braces to if statements, readability-braces-around-statements check),
  or in our case add missing override keywords.

TEST PLAN
  Compiles.

REPOSITORY
  R108 KWin

BRANCH
  override

REVISION DETAIL
  https://phabricator.kde.org/D22371

AFFECTED FILES
  CMakeLists.txt
  abstract_client.h
  abstract_wayland_output.h
  activities.h
  autotests/fakeeffectplugin.cpp
  autotests/fakeeffectplugin_version.cpp
  autotests/integration/debug_console_test.cpp
  autotests/integration/helper/copy.cpp
  autotests/integration/helper/paste.cpp
  autotests/integration/internal_window.cpp
  autotests/integration/kwin_wayland_test.h
  autotests/integration/lockscreen.cpp
  autotests/integration/modifier_only_shortcut_test.cpp
  autotests/integration/no_global_shortcuts_test.cpp
  autotests/integration/plasmawindow_test.cpp
  autotests/integration/pointer_input.cpp
  autotests/mock_abstract_client.h
  autotests/mock_client.h
  autotests/mock_effectshandler.h
  autotests/mock_screens.h
  autotests/mock_workspace.h
  autotests/tabbox/mock_tabboxclient.h
  autotests/tabbox/mock_tabboxhandler.h
  autotests/test_virtualkeyboard_dbus.cpp
  autotests/test_x11_timestamp_update.cpp
  client.h
  client_machine.h
  colorcorrection/colorcorrectdbusinterface.h
  cursor.h
  dbusinterface.h
  debug_console.h
  decorations/decoratedclient.h
  decorations/decorationbridge.h
  decorations/decorationrenderer.h
  decorations/settings.h
  deleted.h
  effectloader.h
  effects.h
  effects/blur/blur_config.h
  effects/colorpicker/colorpicker.h
  effects/coverswitch/coverswitch.h
  effects/coverswitch/coverswitch_config.h
  effects/cube/cube.h
  effects/cube/cube_config.h
  effects/cube/cube_inside.h
  effects/cubeslide/cubeslide.h
  effects/cubeslide/cubeslide_config.h
  effects/desktopgrid/desktopgrid.h
  effects/desktopgrid/desktopgrid_config.h
  effects/fallapart/fallapart.h
  effects/flipswitch/flipswitch.h
  effects/flipswitch/flipswitch_config.h
  effects/highlightwindow/highlightwindow.h
  effects/invert/invert.h
  effects/invert/invert_config.h
  effects/kscreen/kscreen.h
  effects/lookingglass/lookingglass.h
  effects/lookingglass/lookingglass_config.h
  effects/magiclamp/magiclamp.h
  effects/magiclamp/magiclamp_config.h
  effects/magnifier/magnifier.h
  effects/magnifier/magnifier_config.h
  effects/mouseclick/mouseclick.h
  effects/mouseclick/mouseclick_config.h
  effects/mousemark/mousemark.h
  effects/mousemark/mousemark_config.h
  effects/presentwindows/presentwindows.h
  effects/presentwindows/presentwindows_config.h
  effects/resize/resize.h
  effects/resize/resize_config.h
  effects/screenedge/screenedgeeffect.h
  effects/showfps/showfps.h
  effects/showfps/showfps_config.h
  effects/slide/slide_config.h
  effects/slideback/slideback.h
  effects/startupfeedback/startupfeedback.h
  effects/thumbnailaside/thumbnailaside.h
  effects/thumbnailaside/thumbnailaside_config.h
  effects/touchpoints/touchpoints.h
  effects/trackmouse/trackmouse.h
  effects/trackmouse/trackmouse_config.h
  effects/windowgeometry/windowgeometry.h
  effects/windowgeometry/windowgeometry_config.h
  effects/wobblywindows/wobblywindows.h
  effects/wobblywindows/wobblywindows_config.h
  effects/zoom/zoom.h
  effects/zoom/zoom_config.h
  focuschain.h
  geometrytip.h
  globalshortcuts.h
  idle_inhibition.h
  input.h
  kcmkwin/kwincompositing/compositing.h
  kcmkwin/kwindecoration/declarative-plugin/buttonsmodel.h
  kcmkwin/kwindecoration/declarative-plugin/previewbridge.h
  kcmkwin/kwindecoration/declarative-plugin/previewbutton.h
  kcmkwin/kwindecoration/declarative-plugin/previewclient.h
  kcmkwin/kwindecoration/declarative-plugin/previewitem.h
  kcmkwin/kwindecoration/declarative-plugin/previewsettings.h
  kcmkwin/kwindecoration/decorationmodel.h
  kcmkwin/kwinoptions/main.h
  kcmkwin/kwinoptions/mouse.h
  kcmkwin/kwinoptions/windows.h
  kcmkwin/kwinrules/kcm.h
  kcmkwin/kwinrules/ruleslist.h
  kcmkwin/kwinrules/ruleswidget.h
  kcmkwin/kwinscreenedges/main.h
  kcmkwin/kwinscreenedges/monitor.h
  kcmkwin/kwinscreenedges/screenpreviewwidget.h
  kcmkwin/kwinscreenedges/touch.h
  kcmkwin/kwinscripts/module.h
  kcmkwin/kwintabbox/layoutpreview.h
  kcmkwin/kwintabbox/main.h
  kcmkwin/kwintabbox/thumbnailitem.h
  keyboard_input.h
  keyboard_layout_switching.h
  libinput/connection.cpp
  libinput/connection.h
  libinput/device.h
  libinput/events.h
  libkwineffects/kwinanimationeffect.h
  libkwineffects/kwineffects.h
  logind.h
  main.h
  main_wayland.h
  main_x11.h
  netinfo.h
  options.h
  orientation_sensor.h
  outline.h
  outputscreens.h
  platform.h
  platformsupport/scenes/opengl/abstract_egl_backend.h
  plugins/idletime/poller.h
  plugins/kdecorations/aurorae/src/aurorae.h
  plugins/kdecorations/aurorae/src/colorhelper.h
  plugins/kdecorations/aurorae/src/decorationoptions.h
  plugins/kdecorations/aurorae/src/decorationplugin.h
  plugins/kdecorations/aurorae/src/lib/auroraetheme.h
  plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.h
  plugins/kdecorations/aurorae/themes/plastik/code/plastikplugin.h
  plugins/kglobalaccel/kglobalaccel_plugin.h
  plugins/platforms/drm/drm_backend.h
  plugins/platforms/drm/drm_buffer.h
  plugins/platforms/drm/drm_buffer_gbm.h
  plugins/platforms/drm/drm_inputeventfilter.h
  plugins/platforms/drm/drm_object_connector.h
  plugins/platforms/drm/drm_object_crtc.h
  plugins/platforms/drm/drm_object_plane.h
  plugins/platforms/drm/egl_gbm_backend.h
  plugins/platforms/drm/egl_stream_backend.h
  plugins/platforms/drm/remoteaccess_manager.h
  plugins/platforms/drm/scene_qpainter_drm_backend.h
  plugins/platforms/drm/screens_drm.h
  plugins/platforms/fbdev/fb_backend.h
  plugins/platforms/fbdev/scene_qpainter_fb_backend.h
  plugins/platforms/virtual/egl_gbm_backend.h
  plugins/platforms/virtual/scene_qpainter_virtual_backend.h
  plugins/platforms/virtual/screens_virtual.h
  plugins/platforms/virtual/virtual_backend.h
  plugins/platforms/virtual/virtual_output.h
  plugins/platforms/wayland/egl_wayland_backend.h
  plugins/platforms/wayland/scene_qpainter_wayland_backend.h
  plugins/platforms/wayland/wayland_backend.h
  plugins/platforms/wayland/wayland_output.h
  plugins/platforms/x11/common/eglonxbackend.h
  plugins/platforms/x11/standalone/edge.h
  plugins/platforms/x11/standalone/glxbackend.h
  plugins/platforms/x11/standalone/non_composited_outline.h
  plugins/platforms/x11/standalone/overlaywindow_x11.h
  plugins/platforms/x11/standalone/screens_xrandr.h
  plugins/platforms/x11/standalone/windowselector.h
  plugins/platforms/x11/standalone/x11_decoration_renderer.h
  plugins/platforms/x11/standalone/x11_output.h
  plugins/platforms/x11/standalone/x11_platform.h
  plugins/platforms/x11/standalone/x11cursor.h
  plugins/platforms/x11/standalone/xinputintegration.cpp
  plugins/platforms/x11/standalone/xinputintegration.h
  plugins/platforms/x11/windowed/egl_x11_backend.h
  plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h
  plugins/platforms/x11/windowed/x11windowed_backend.h
  plugins/qpa/abstractplatformcontext.h
  plugins/qpa/backingstore.h
  plugins/qpa/integration.h
  plugins/qpa/platformcursor.h
  plugins/qpa/screen.h
  plugins/qpa/window.h
  plugins/scenes/opengl/lanczosfilter.h
  plugins/scenes/opengl/scene_opengl.h
  plugins/scenes/qpainter/scene_qpainter.h
  plugins/scenes/xrender/scene_xrender.h
  pointer_input.h
  rules.h
  scene.h
  screenedge.h
  screenlockerwatcher.h
  screens.h
  scripting/dbuscall.h
  scripting/genericscriptedconfig.h
  scripting/screenedgeitem.h
  scripting/scriptedeffect.h
  scripting/scripting.h
  scripting/scripting_model.h
  shadow.h
  shell_client.h
  sm.h
  tabbox/clientmodel.h
  tabbox/desktopchain.h
  tabbox/desktopmodel.h
  tabbox/switcheritem.h
  tabbox/tabbox.h
  tabbox/tabboxhandler.h
  tabletmodemanager.h
  tests/cursorhotspottest.cpp
  tests/pointergesturestest.cpp
  tests/screenedgeshowtest.cpp
  tests/waylandclienttest.h
  thumbnailitem.h
  toplevel.h
  touch_input.h
  unmanaged.h
  useractions.h
  utils.h
  virtual_terminal.h
  virtualdesktops.h
  virtualkeyboard.h
  virtualkeyboard_dbus.h
  wayland_cursor_theme.h
  wayland_server.h
  workspace.h
  xkb.h
  xwl/databridge.h
  xwl/drag_x.h
  xwl/transfer.h
  xwl/xwayland_interface.h

To: zzag, #kwin
Cc: kwin, LeGast00n, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20190710/453cea63/attachment-0001.html>


More information about the kwin mailing list