diff --git a/appimage/kdevelop-recipe-centos6.sh b/appimage/kdevelop-recipe-centos6.sh index debb0f1c5e..a14039e2cc 100755 --- a/appimage/kdevelop-recipe-centos6.sh +++ b/appimage/kdevelop-recipe-centos6.sh @@ -1,532 +1,526 @@ #!/bin/bash # Halt on errors set -e # Be verbose set -x # Now we are inside CentOS 6 grep -r "CentOS release 6" /etc/redhat-release || exit 1 git_pull_rebase_helper() { git fetch git stash || true git rebase $(git rev-parse --abbrev-ref --symbolic-full-name @{u}) || true git stash pop || true } SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" QTVERSION=5.9.6 QTVERSION_SHORT=5.9 QTDIR=/usr/local/Qt-${QTVERSION}/ if [ -z "$KDEVELOP_VERSION" ]; then KDEVELOP_VERSION=5.3 fi if [ -z "$KDEV_PG_QT_VERSION" ]; then KDEV_PG_QT_VERSION=2.0 fi -if [ -z "$KDEV_CLANG_TIDY_VERSION" ]; then - KDEV_CLANG_TIDY_VERSION=v0.3.0 -fi KF5_VERSION=v5.48.0 # note: v5.49.0 is broken due to https://phabricator.kde.org/R246:0a96acf251baa5c9dd042d093ab2bf8fcee10502 KDE_PLASMA_VERSION=v5.13.4 # note: need libksysguard commit a0e69617442d720c76da5ebe3323e7a977929db4 (patch which makes plasma dep optional) KDE_APPLICATION_VERSION=v18.08.0 GRANTLEE_VERSION=v5.1.0 export LLVM_ROOT=/opt/llvm/ export PATH=/opt/rh/python27/root/usr/bin/:$PATH export LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64:$LD_LIBRARY_PATH # qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment. That's # not always set correctly in CentOS 6.7 export LC_ALL=en_US.UTF-8 export LANG=en_us.UTF-8 # Determine which architecture should be built if [[ "$(arch)" = "i686" || "$(arch)" = "x86_64" ]] ; then ARCH=$(arch) else echo "Architecture could not be determined" exit 1 fi # Make sure we build from the /, parts of this script depends on that. We also need to run as root... cd / # Build AppImageKit #rm -Rf /AppImageKit if [ ! -d AppImageKit ] ; then git clone --depth 1 https://github.com/probonopd/AppImageKit.git /AppImageKit fi cd /AppImageKit/ git checkout stable/v1.0 git_pull_rebase_helper git reset --hard ./build.sh cd / # Use the new compiler . /opt/rh/devtoolset-6/enable # TODO: Use these vars more export FAKEROOT=/kdevelop.appdir export PREFIX=/kdevelop.appdir/usr/ export SRC=$HOME/src/ export BUILD=$HOME/build export CMAKE_PREFIX_PATH=$QTDIR:/kdevelop.appdir/share/llvm/ # if the library path doesn't point to our usr/lib, linking will be broken and we won't find all deps either export LD_LIBRARY_PATH=/usr/lib64/:/usr/lib:/kdevelop.appdir/usr/lib:$QTDIR/lib/:/opt/python3.6/lib/:$LD_LIBRARY_PATH # Workaround for: On CentOS 6, .pc files in /usr/lib/pkgconfig are not recognized # However, this is where .pc files get installed when bulding libraries... (FIXME) # I found this by comparing the output of librevenge's "make install" command # between Ubuntu and CentOS 6 ln -sf /usr/share/pkgconfig /usr/lib/pkgconfig # Prepare the install location if [ -z "$SKIP_PRUNE" ]; then rm -rf /kdevelop.appdir/ || true mkdir -p /kdevelop.appdir/usr # refresh ldconfig cache ldconfig # make sure lib and lib64 are the same thing mkdir -p /kdevelop.appdir/usr/lib cd /kdevelop.appdir/usr ln -s lib lib64 fi # start building the deps function build_project { ( PROJECT=$1 VERSION=$2 # clone if not there mkdir -p $SRC cd $SRC if ( test -d $PROJECT ) then echo "$PROJECT already cloned" cd $PROJECT git stash git reset --hard git fetch git fetch --tags cd .. else if [ -z "$CUSTOM_GIT_URL" ]; then git clone git://anongit.kde.org/$PROJECT else git clone $CUSTOM_GIT_URL fi fi cd $PROJECT git checkout $VERSION git rebase $(git rev-parse --abbrev-ref --symbolic-full-name @{u}) || true # git rebase will fail if a tag is checked out git stash pop || true cd .. if [ "$PROJECT" = "knotifications" ]; then cd $PROJECT echo "patching knotifications" git reset --hard cat > no_phonon.patch << EOF diff --git a/CMakeLists.txt b/CMakeLists.txt index b97425f..8f15f08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,10 +59,10 @@ find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) -find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) +find_package(Phonon4Qt5 4.6.60 NO_MODULE) set_package_properties(Phonon4Qt5 PROPERTIES DESCRIPTION "Qt-based audio library" - TYPE REQUIRED + TYPE OPTIONAL PURPOSE "Required to build audio notification support") if (Phonon4Qt5_FOUND) add_definitions(-DHAVE_PHONON4QT5) EOF cat no_phonon.patch |patch -p1 cd .. fi # create build dir mkdir -p $BUILD/$PROJECT # go there cd $BUILD/$PROJECT # cmake it cmake3 $SRC/$PROJECT -G Ninja -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $3 # make ninja # install ninja install ) } function build_framework { ( build_project $1 $KF5_VERSION $2 ) } # KDE Frameworks if [ -z "$SKIP_FRAMEWORKS" ]; then build_framework extra-cmake-modules build_framework kconfig build_framework kguiaddons build_framework ki18n build_framework kitemviews build_framework sonnet build_framework kwindowsystem build_framework kwidgetsaddons build_framework kcompletion build_framework kdbusaddons build_framework karchive build_framework kcoreaddons build_framework kjobwidgets build_framework kcrash build_framework kservice build_framework kcodecs build_framework kauth build_framework kconfigwidgets build_framework kiconthemes build_framework ktextwidgets build_framework kglobalaccel build_framework kxmlgui build_framework kbookmarks build_framework solid build_framework kio build_framework kparts build_framework kitemmodels build_framework threadweaver build_framework attica build_framework knewstuff build_framework syntax-highlighting build_framework ktexteditor build_framework kpackage build_framework kdeclarative build_framework kcmutils build_framework knotifications build_framework knotifyconfig build_framework kdoctools build_framework breeze-icons -DBINARY_ICONS_RESOURCE=1 build_framework kpty build_framework kinit fi # KDE Plasma build_project libksysguard $KDE_PLASMA_VERSION build_project kdecoration $KDE_PLASMA_VERSION # for breeze build_project breeze $KDE_PLASMA_VERSION # KDE Applications build_project libkomparediff2 $KDE_APPLICATION_VERSION build_project kate $KDE_APPLICATION_VERSION # for snippet plugin, see T3826 build_project konsole $KDE_APPLICATION_VERSION # Extra (CUSTOM_GIT_URL=https://github.com/steveire/grantlee.git build_project grantlee $GRANTLEE_VERSION) # KDevelop build_project kdevelop-pg-qt $KDEV_PG_QT_VERSION build_project kdevelop $KDEVELOP_VERSION build_project kdev-php $KDEVELOP_VERSION # Build kdev-python export LD_LIBRARY_PATH=$LD_LIBRARY_PATH/kdevelop.appdir/usr/lib/ build_project kdev-python $KDEVELOP_VERSION -# Build kdev-clang-tidy -build_project kdev-clang-tidy $KDEV_CLANG_TIDY_VERSION - # Install some colorschemes cd $SRC $SCRIPT_DIR/install_colorschemes.sh cd /kdevelop.appdir # FIXME: How to find out which subset of plugins is really needed? I used strace when running the binary mkdir -p ./usr/lib/qt5/plugins/ if [ -e $(dirname $QTDIR/plugins/bearer) ] ; then PLUGINS=$(dirname $QTDIR/plugins/bearer) else PLUGINS=../../$QTVERSION_SHORT/gc*/plugins/ fi echo "Using plugin dir: $PLUGINS" # /usr/lib64/qt5/plugins if build system Qt is found cp -r $PLUGINS/bearer ./usr/lib/qt5/plugins/ cp -r $PLUGINS/generic ./usr/lib/qt5/plugins/ cp -r $PLUGINS/imageformats ./usr/lib/qt5/plugins/ cp -r $PLUGINS/platforms ./usr/lib/qt5/plugins/ cp -r $PLUGINS/iconengines ./usr/lib/qt5/plugins/ cp -r $PLUGINS/platforminputcontexts ./usr/lib/qt5/plugins/ # cp -r $PLUGINS/platformthemes ./usr/lib/qt5/plugins/ cp -r $PLUGINS/sqldrivers ./usr/lib/qt5/plugins/ # qsqlite is required for the Welcome Page plugin and for QtHelp cp -r $PLUGINS/xcbglintegrations ./usr/lib/qt5/plugins/ mkdir -p ./usr/lib/qt5/qml QML_DIR=$QTDIR/qml # for the Welcome Page plugin cp -r $QML_DIR/QtQuick ./usr/lib/qml cp -r $QML_DIR/QtQuick.2 ./usr/lib/qml cp -R /kdevelop.appdir/usr/lib/grantlee/ /kdevelop.appdir/usr/lib/qt5/plugins/ rm -Rf /kdevelop.appdir/usr/lib/grantlee mkdir -p /kdevelop.appdir/$LLVM_ROOT/lib/ cp -r $LLVM_ROOT/lib/clang /kdevelop.appdir/$LLVM_ROOT/lib cp -ru /usr/share/mime/* /kdevelop.appdir/usr/share/mime update-mime-database /kdevelop.appdir/usr/share/mime/ cp -R ./usr/lib/plugins/* ./usr/lib/qt5/plugins/ rm -Rf ./usr/lib/plugins/ cp $(ldconfig -p | grep libsasl2.so.2 | cut -d ">" -f 2 | xargs) ./usr/lib/ # Fedora 23 seemed to be missing SOMETHING from the Centos 6.7. The only message was: # This application failed to start because it could not find or load the Qt platform plugin "xcb". # Setting export QT_DEBUG_PLUGINS=1 revealed the cause. # QLibraryPrivate::loadPlugin failed on "/usr/lib64/qt5/plugins/platforms/libqxcb.so" : # "Cannot load library /usr/lib64/qt5/plugins/platforms/libqxcb.so: (/lib64/libEGL.so.1: undefined symbol: drmGetNodeTypeFromFd)" # Which means that we have to copy libEGL.so.1 in too cp $(ldconfig -p | grep libEGL.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/ # Otherwise F23 cannot load the Qt platform plugin "xcb" cp $(ldconfig -p | grep libxcb.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/ cp $(ldconfig -p | grep libfreetype.so.6 | cut -d ">" -f 2 | xargs) ./usr/lib/ # For Fedora 20 ldd usr/bin/kdevelop | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true cp /usr/bin/cmake usr/bin/cmake ldd usr/bin/cmake | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true #ldd usr/lib64/kdevelop/*.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true #ldd usr/lib64/plugins/imageformats/*.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true ldd usr/lib/qt5/plugins/platforms/libqxcb.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true # Copy in the indirect dependencies FILES=$(find . -type f -executable) for FILE in $FILES ; do echo "*** Processing:" $FILE ldd "${FILE}" | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -vu '{}' usr/lib || true done # The following are assumed to be part of the base system rm -f usr/lib/libcom_err.so.2 || true rm -f usr/lib/libcrypt.so.1 || true rm -f usr/lib/libdl.so.2 || true rm -f usr/lib/libexpat.so.1 || true #rm -f usr/lib/libfontconfig.so.1 || true rm -f usr/lib/libgcc_s.so.1 || true rm -f usr/lib/libglib-2.0.so.0 || true rm -f usr/lib/libgpg-error.so.0 || true rm -f usr/lib/libgssapi_krb5.so.2 || true rm -f usr/lib/libgssapi.so.3 || true rm -f usr/lib/libhcrypto.so.4 || true rm -f usr/lib/libheimbase.so.1 || true rm -f usr/lib/libheimntlm.so.0 || true rm -f usr/lib/libhx509.so.5 || true rm -f usr/lib/libICE.so.6 || true rm -f usr/lib/libidn.so.11 || true rm -f usr/lib/libk5crypto.so.3 || true rm -f usr/lib/libkeyutils.so.1 || true rm -f usr/lib/libkrb5.so.26 || true rm -f usr/lib/libkrb5.so.3 || true rm -f usr/lib/libkrb5support.so.0 || true # rm -f usr/lib/liblber-2.4.so.2 || true # needed for debian wheezy # rm -f usr/lib/libldap_r-2.4.so.2 || true # needed for debian wheezy rm -f usr/lib/libm.so.6 || true rm -f usr/lib/libp11-kit.so.0 || true rm -f usr/lib/libpcre.so.3 || true rm -f usr/lib/libpthread.so.0 || true rm -f usr/lib/libresolv.so.2 || true rm -f usr/lib/libroken.so.18 || true rm -f usr/lib/librt.so.1 || true rm -f usr/lib/libSM.so.6 || true rm -f usr/lib/libusb-1.0.so.0 || true rm -f usr/lib/libuuid.so.1 || true rm -f usr/lib/libwind.so.0 || true # Remove these libraries, we need to use the system versions; this means 11.04 is not supported (12.04 is our baseline) rm -f usr/lib/libGL.so.* || true rm -f usr/lib/libdrm.so.* || true #rm -f usr/lib/libz.so.1 || true # These seem to be available on most systems but not Ubuntu 11.04 # rm -f usr/lib/libffi.so.6 usr/lib/libGL.so.1 usr/lib/libglapi.so.0 usr/lib/libxcb.so.1 usr/lib/libxcb-glx.so.0 || true # Delete potentially dangerous libraries rm -f usr/lib/libstdc* usr/lib/libgobject* usr/lib/libc.so.* || true # Do NOT delete libX* because otherwise on Ubuntu 11.04: # loaded library "Xcursor" malloc.c:3096: sYSMALLOc: Assertion (...) Aborted # We don't bundle the developer stuff rm -rf usr/include || true rm -rf usr/lib/cmake || true rm -rf usr/lib/pkgconfig || true rm -rf usr/share/ECM/ || true rm -rf usr/share/gettext || true rm -rf usr/share/pkgconfig || true strip -g $(find usr/bin usr/lib -type f) || true # We do not bundle this, so let's not search that inside the AppImage. # Fixes "Qt: Failed to create XKB context!" and lets us enter text #sed -i -e 's|././/share/X11/|/usr/share/X11/|g' ./usr/lib/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so #sed -i -e 's|././/share/X11/|/usr/share/X11/|g' ./usr/lib/libQt5XcbQpa.so.5 # Workaround for: # D-Bus library appears to be incorrectly set up; # failed to read machine uuid: Failed to open # The file is more commonly in /etc/machine-id # sed -i -e 's|/var/lib/dbus/machine-id|//././././etc/machine-id|g' ./usr/lib/libdbus-1.so.3 # or rm -f ./usr/lib/libdbus-1.so.3 || true # Remove python rm -f ./usr/bin/python* rm -f ./usr/bin/pydoc* rm -f ./usr/bin/pyenv* # remove big execs rm -f ./usr/bin/verify-uselistorder rm -f ./usr/bin/obj2yaml ./usr/bin/yaml2obj rm -f ./usr/bin/kwrite ./usr/bin/kate cp /kdevelop.appdir/usr/lib/libexec/kf5/* /kdevelop.appdir/usr/bin/ cd / if [ ! -d appimage-exec-wrapper ]; then git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper fi; cd /appimage-exec-wrapper/ make clean make cd /kdevelop.appdir cp -v /appimage-exec-wrapper/exec.so exec_wrapper.so cat > AppRun << EOF #!/bin/bash DIR="\`dirname \"\$0\"\`" DIR="\`( cd \"\$DIR\" && pwd )\`" export APPDIR=\$DIR export LD_PRELOAD=\$DIR/exec_wrapper.so export APPIMAGE_ORIGINAL_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH export APPIMAGE_ORIGINAL_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH export APPIMAGE_ORIGINAL_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH export APPIMAGE_ORIGINAL_XDG_DATA_DIRS=\$XDG_DATA_DIRS export APPIMAGE_ORIGINAL_PATH=\$PATH export APPIMAGE_ORIGINAL_PYTHONHOME=\$PYTHONHOME export QML2_IMPORT_PATH=\$DIR/usr/lib/qml:\$QML2_IMPORT_PATH export LD_LIBRARY_PATH=\$DIR/usr/lib/:\$LD_LIBRARY_PATH export QT_PLUGIN_PATH=\$DIR/usr/lib/qt5/plugins/ export XDG_DATA_DIRS=\$DIR/usr/share/:\$XDG_DATA_DIRS export PATH=\$DIR/usr/bin:\$PATH export KDE_FORK_SLAVES=1 export PYTHONHOME=\$DIR/usr/ export APPIMAGE_STARTUP_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH export APPIMAGE_STARTUP_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH export APPIMAGE_STARTUP_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH export APPIMAGE_STARTUP_XDG_DATA_DIRS=\$XDG_DATA_DIRS export APPIMAGE_STARTUP_PATH=\$PATH export APPIMAGE_STARTUP_PYTHONHOME=\$PYTHONHOME export KDEV_CLANG_BUILTIN_DIR=\$DIR/opt/llvm/lib/clang/6.0.1/include export KDEV_DISABLE_PLUGINS=KDevWelcomePage cd \$HOME kdevelop \$@ EOF chmod +x AppRun cat > kdevelop.desktop << EOF [Desktop Entry] GenericName=Integrated development environment Name=KDevelop MimeType=text/plain; Exec=AppRun -b %U StartupNotify=true X-KDE-HasTempFileOption=true Icon=kdevelop X-DocPath=kdevelop/index.html Type=Application Terminal=false InitialPreference=9 Categories=Qt;KDE;Utility;TextEditor; EOF cp $SRC/kdevelop/app/icons/48-apps-kdevelop.png kdevelop.png cp -R /usr/lib/python3.6 /kdevelop.appdir/usr/lib/ rm -Rf /kdevelop.appdir/usr/lib/python3.6/{test,config-3.5m,__pycache__,site-packages,lib-dynload,distutils,idlelib,unittest,tkinter,ensurepip} mkdir -p /kdevelop.appdir/usr/share/kdevelop/ cp $BUILD/breeze-icons/icons/breeze-icons.rcc /kdevelop.appdir/usr/share/kdevelop/icontheme.rcc rm -Rf /kdevelop.appdir/usr/share/icons/breeze* # not needed because of the rcc rm -f /kdevelop.appdir/usr/bin/llvm* rm -f /kdevelop.appdir/usr/bin/clang* rm -f /kdevelop.appdir/usr/bin/opt rm -f /kdevelop.appdir/usr/bin/lli rm -f /kdevelop.appdir/usr/bin/sancov rm -f /kdevelop.appdir/usr/bin/cmake rm -f /kdevelop.appdir/usr/bin/python rm -Rf /kdevelop.appdir/usr/lib/pkgconfig rm -Rf /kdevelop.appdir/usr/share/man rm -Rf /kdevelop.appdir/usr/share/locale rm -Rf /kdevelop.appdir/usr/lib/libLTO.so #At first it seems like "we shouldn't ship X11", but actually we should; the X11 protocol is sort of guaranteed to stay compatible, #while these libraries are not. # rm -Rf /kdevelop.appdir/usr/lib/libxcb* # add that back in # cp /usr/lib64/libxcb-keysyms.so.1 /kdevelop.appdir/usr/lib/ # rm -Rf /kdevelop.appdir/usr/lib/{libX11.so.6,libXau.so.6,libXext.so.6,libXi.so.6,libXxf86vm.so.1,libX11-xcb.so.1,libXdamage.so.1,libXfixes.so.3,libXrender.so.1} rm -f /kdevelop.appdir/usr/bin/llc rm -f /kdevelop.appdir/usr/bin/bugpoint find /kdevelop.appdir -name '*.a' -exec rm {} \; echo "Final listing of files which will end up in the AppImage:" find /kdevelop.appdir cd / APP=KDevelop VERSION="git" if [[ "$ARCH" = "x86_64" ]] ; then APPIMAGE=$APP"-"$VERSION"-x86_64.AppImage" fi if [[ "$ARCH" = "i686" ]] ; then APPIMAGE=$APP"-"$VERSION"-i386.AppImage" fi echo $APPIMAGE mkdir -p /out rm -f /out/*.AppImage || true AppImageKit/AppImageAssistant.AppDir/package /kdevelop.appdir/ /out/$APPIMAGE chmod a+rwx /out/$APPIMAGE # So that we can edit the AppImage outside of the Docker container diff --git a/plugins/clangtidy/cmake/FindClangTidy.cmake b/cmake/modules/FindClangTidy.cmake similarity index 100% rename from plugins/clangtidy/cmake/FindClangTidy.cmake rename to cmake/modules/FindClangTidy.cmake diff --git a/kdevelop.categories b/kdevelop.categories index ed842083a0..cafc2723a2 100644 --- a/kdevelop.categories +++ b/kdevelop.categories @@ -1,60 +1,61 @@ # KDebugSettings data file # Format: # lognamedescription # Plugins kdevelop.plugins.android KDevelop plugin: android kdevelop.plugins.appwizard KDevelop plugin: appwizard kdevelop.plugins.astyle KDevelop plugin: astyle kdevelop.plugins.clang KDevelop plugin: clang-based language support +kdevelop.plugins.clangtidy KDevelop plugin: clangtidy kdevelop.plugins.classbrowser KDevelop plugin: classbrowser kdevelop.plugins.clazy KDevelop plugin: clazy kdevelop.plugins.cmake KDevelop plugin: cmake kdevelop.plugins.cmakebuilder KDevelop plugin: cmakebuilder kdevelop.plugins.codeutils KDevelop plugin: codeutils kdevelop.plugins.common KDevelop plugin: debuggers common kdevelop.plugins.contextbrowser KDevelop plugin: contextbrowser kdevelop.plugins.cppcheck KDevelop plugin: cppcheck kdevelop.plugins.custombuildsystem KDevelop plugin: custombuildsystem kdevelop.plugins.custommake KDevelop plugin: custommake kdevelop.plugins.customscript KDevelop plugin: customscript kdevelop.plugins.cvs KDevelop plugin: cvs kdevelop.plugins.definesandincludes KDevelop plugin: definesandincludes kdevelop.plugins.docker KDevelop plugin: docker kdevelop.plugins.documentswitcher KDevelop plugin: documentswitcher kdevelop.plugins.execute KDevelop plugin: execute kdevelop.plugins.executeplasmoid KDevelop plugin: executeplasmoid kdevelop.plugins.executescript KDevelop plugin: executescript kdevelop.plugins.externalscript KDevelop plugin: externalscript kdevelop.plugins.filemanager KDevelop plugin: filemanager kdevelop.plugins.filetemplates KDevelop plugin: filetemplates kdevelop.plugins.flatpak KDevelop plugin: flatpak kdevelop.plugins.gdb KDevelop plugin: gdb kdevelop.plugins.ghprovider KDevelop plugin: githubprovider kdevelop.plugins.git KDevelop plugin: git kdevelop.plugins.grepview KDevelop plugin: grepview kdevelop.plugins.heaptrack KDevelop plugin: heaptrack kdevelop.plugins.konsole KDevelop plugin: konsole kdevelop.plugins.lldb KDevelop plugin: lldb kdevelop.plugins.makebuilder KDevelop plugin: makebuilder kdevelop.plugins.ninjabuilder KDevelop plugin: ninjabuilder kdevelop.plugins.outline KDevelop plugin: outline kdevelop.plugins.patchreview KDevelop plugin: patchreview kdevelop.plugins.perforce KDevelop plugin: perforce kdevelop.plugins.problemreporter KDevelop plugin: problemreporter kdevelop.plugins.projectfilter KDevelop plugin: projectfilter kdevelop.plugins.projectmanagerview KDevelop plugin: projectmanagerview kdevelop.plugins.qmake KDevelop plugin: qmake kdevelop.plugins.qmakebuilder KDevelop plugin: qmakebuilder kdevelop.plugins.qmljs KDevelop plugin: qmljs kdevelop.plugins.qmljs.duchain KDevelop plugin: qmljs duchain kdevelop.plugins.qthelp KDevelop plugin: qthelp kdevelop.plugins.quickopen KDevelop plugin: quickopen kdevelop.plugins.standardoutputview KDevelop plugin: standardoutputview kdevelop.plugins.svn KDevelop plugin: svn kdevelop.plugins.switchtobuddy KDevelop plugin: switchtobuddy kdevelop.plugins.testview KDevelop plugin: testview kdevelop.plugins.welcomepage KDevelop plugin: welcomepage # Programs kdevelop.app KDevelop app diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 83ca20ac73..9f7dab8c4e 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,152 +1,153 @@ # BEGIN: Analyzers +add_subdirectory(clangtidy) add_subdirectory(clazy) add_subdirectory(cppcheck) if(UNIX AND NOT (APPLE OR CYGWIN)) add_subdirectory(heaptrack) endif() # END: Analyzers # BEGIN: Debuggers add_subdirectory(debuggercommon) add_subdirectory(lldb) add_subdirectory(gdb) # END: Debuggers # BEGIN: Documentation find_package(Qt5Help CONFIG) set_package_properties(Qt5Help PROPERTIES PURPOSE "The Help module for the Qt toolkit, needed for the qthelp plugin" URL "https://www.qt.io/" TYPE OPTIONAL) if(Qt5Help_FOUND) ecm_optional_add_subdirectory(qthelp) endif() ecm_optional_add_subdirectory(manpage) # END: Documentation # BEGIN: Formatters add_subdirectory(astyle) add_subdirectory(customscript) # END: Formatters # BEGIN: Languages ecm_optional_add_subdirectory(custom-definesandincludes) ecm_optional_add_subdirectory(qmljs) find_package(Clang 3.8) set(clangSearchHint "") if (NOT CLANG_FOUND) set(clangSearchHint "Please install a package providing libclang. Either pass -DLLVM_ROOT=/path/to/llvm-prefix or install the 'llvm-config' command-line utility for auto-detection.") endif() set_package_properties(Clang PROPERTIES DESCRIPTION "Clang libraries from the LLVM project. ${clangSearchHint}" PURPOSE "Used for KDevelop's C++/C support plugin." TYPE REQUIRED ) if (CLANG_FOUND) if (NOT CLANG_CLANG_LIB) message(FATAL_ERROR "Could not find the Clang C library: libclang") endif() add_library(Clang::clang UNKNOWN IMPORTED) set_property(TARGET Clang::clang PROPERTY IMPORTED_LOCATION ${CLANG_CLANG_LIB}) ecm_optional_add_subdirectory(clang) endif() # END: Languages # BEGIN: Project builders add_subdirectory(makebuilder) add_subdirectory(ninjabuilder) ecm_optional_add_subdirectory(cmakebuilder) if (KDevelop-PG-Qt_FOUND) ecm_optional_add_subdirectory(qmakebuilder) endif() # END: Project builders # BEGIN: Project managers ecm_optional_add_subdirectory(cmake) ecm_optional_add_subdirectory(custommake) ecm_optional_add_subdirectory(custom-buildsystem) if (KDevelop-PG-Qt_FOUND) ecm_optional_add_subdirectory(qmakemanager) endif() ecm_optional_add_subdirectory(genericprojectmanager) # END: Project managers # BEGIN: Runtimes add_subdirectory(android) if (UNIX) add_subdirectory(docker) add_subdirectory(flatpak) endif() # END: Runtimes # BEGIN: VCS ecm_optional_add_subdirectory(bazaar) ecm_optional_add_subdirectory(cvs) ecm_optional_add_subdirectory(git) ecm_optional_add_subdirectory(perforce) find_package(SubversionLibrary) set_package_properties(SubversionLibrary PROPERTIES PURPOSE "Support for Subversion integration" URL "http://subversion.tigris.org" TYPE OPTIONAL) if(SubversionLibrary_FOUND) ecm_optional_add_subdirectory(subversion) endif() add_subdirectory(vcschangesview) # END: VCS # BEGIN: Others add_subdirectory(appwizard) add_subdirectory(codeutils) add_subdirectory(contextbrowser) add_subdirectory(documentswitcher) add_subdirectory(documentview) add_subdirectory(execute) add_subdirectory(executescript) add_subdirectory(externalscript) add_subdirectory(filemanager) add_subdirectory(filetemplates) add_subdirectory(grepview) add_subdirectory(openwith) add_subdirectory(outlineview) add_subdirectory(patchreview) add_subdirectory(problemreporter) add_subdirectory(projectfilter) add_subdirectory(projectmanagerview) add_subdirectory(quickopen) add_subdirectory(sourceformatter) add_subdirectory(standardoutputview) add_subdirectory(switchtobuddy) add_subdirectory(testview) ecm_optional_add_subdirectory(classbrowser) ecm_optional_add_subdirectory(executeplasmoid) ecm_optional_add_subdirectory(ghprovider) ecm_optional_add_subdirectory(kdeprovider) ecm_optional_add_subdirectory(konsole) if (Qt5QuickWidgets_FOUND) add_subdirectory(welcomepage) endif() find_package(OktetaKastenControllers 0.3.1) set_package_properties(OktetaKastenControllers PROPERTIES PURPOSE "Required for building Okteta KDevelop plugin." URL "http://kde.org/" TYPE OPTIONAL) if (OktetaKastenControllers_FOUND) find_package( KastenControllers ) set_package_properties(KastenControllers PROPERTIES PURPOSE "Required for building Okteta KDevelop plugin." URL "http://kde.org/" TYPE OPTIONAL) endif() if (OktetaKastenControllers_FOUND AND KastenControllers_FOUND) add_subdirectory(okteta) endif() # END: Others diff --git a/plugins/clangtidy/.arcconfig b/plugins/clangtidy/.arcconfig deleted file mode 100644 index 84713775fc..0000000000 --- a/plugins/clangtidy/.arcconfig +++ /dev/null @@ -1,3 +0,0 @@ -{ - "phabricator.uri" : "https://phabricator.kde.org/project/profile/29/" -} diff --git a/plugins/clangtidy/.clang-format b/plugins/clangtidy/.clang-format deleted file mode 100644 index e728dcb1e6..0000000000 --- a/plugins/clangtidy/.clang-format +++ /dev/null @@ -1,26 +0,0 @@ ---- -BasedOnStyle: WebKit -Language: Cpp -AlignAfterOpenBracket: true -AlwaysBreakTemplateDeclarations: true -AllowShortFunctionsOnASingleLine: Inline -AllowShortIfStatementsOnASingleLine: false -BreakBeforeBraces: Linux -ColumnLimit: 120 -Standard: Cpp11 -IndentWidth: 4 -TabWidth: 8 -UseTab: Never -PointerAlignment: Left -SpacesInParentheses: false -SpacesInAngles: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -SpaceBeforeAssignmentOperators: true -ContinuationIndentWidth: 4 -# Only for newer clang-format versions -#MacroBlockBegin: BEGINTESTFUNCIMPL -#MacroBlockEnd: ENDTESTFUNCIMPL -... - diff --git a/plugins/clangtidy/.clang-tidy b/plugins/clangtidy/.clang-tidy deleted file mode 100644 index dd05990183..0000000000 --- a/plugins/clangtidy/.clang-tidy +++ /dev/null @@ -1,307 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,cert-dcl03-c,cert-dcl50-cpp,cert-dcl54-cpp,cert-dcl59-cpp,cert-err52-cpp,cert-err58-cpp,cert-err60-cpp,cert-err61-cpp,cert-fio38-c,cert-oop11-cpp,clang-analyzer-core.CallAndMessage,clang-analyzer-core.DivideZero,clang-analyzer-core.DynamicTypePropagation,clang-analyzer-core.NonNullParamChecker,clang-analyzer-core.NullDereference,clang-analyzer-core.StackAddressEscape,clang-analyzer-core.UndefinedBinaryOperatorResult,clang-analyzer-core.VLASize,clang-analyzer-core.builtin.BuiltinFunctions,clang-analyzer-core.builtin.NoReturnFunctions,clang-analyzer-core.uninitialized.ArraySubscript,clang-analyzer-core.uninitialized.Assign,clang-analyzer-core.uninitialized.Branch,clang-analyzer-core.uninitialized.CapturedBlockVariable,clang-analyzer-core.uninitialized.UndefReturn,clang-analyzer-cplusplus.NewDelete,clang-analyzer-cplusplus.NewDeleteLeaks,clang-analyzer-deadcode.DeadStores,clang-analyzer-security.FloatLoopCounter,clang-analyzer-security.insecureAPI.UncheckedReturn,clang-analyzer-security.insecureAPI.getpw,clang-analyzer-security.insecureAPI.gets,clang-analyzer-security.insecureAPI.mkstemp,clang-analyzer-security.insecureAPI.mktemp,clang-analyzer-security.insecureAPI.rand,clang-analyzer-security.insecureAPI.strcpy,clang-analyzer-security.insecureAPI.vfork,cppcoreguidelines-c-copy-assignment-signature,cppcoreguidelines-pro-bounds-array-to-pointer-decay,cppcoreguidelines-pro-bounds-constant-array-index,cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-type-const-cast,cppcoreguidelines-pro-type-cstyle-cast,cppcoreguidelines-pro-type-reinterpret-cast,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-pro-type-union-access,cppcoreguidelines-pro-type-vararg,misc-definitions-in-headers,misc-inaccurate-erase,misc-inefficient-algorithm,misc-macro-parentheses,misc-macro-repeated-side-effects,misc-move-const-arg,misc-move-constructor-init,misc-new-delete-overloads,misc-noexcept-move-constructor,misc-non-copyable-objects,misc-sizeof-container,misc-static-assert,misc-string-integer-assignment,misc-swapped-arguments,misc-throw-by-value-catch-by-reference,misc-undelegated-constructor,misc-uniqueptr-reset-release,misc-unused-alias-decls,misc-unused-parameters,misc-unused-raii,misc-virtual-near-miss,modernize-loop-convert,modernize-make-unique,modernize-pass-by-value,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-shrink-to-fit,modernize-use-auto,modernize-use-default,modernize-use-nullptr,modernize-use-override,performance-unnecessary-copy-initialization,readability-braces-around-statements,readability-container-size-empty,readability-else-after-return,readability-function-size,readability-identifier-naming,readability-implicit-bool-cast,readability-inconsistent-declaration-parameter-name,readability-named-parameter,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-simplify-boolean-expr,readability-uniqueptr-delete-release' -HeaderFilterRegex: '' -AnalyzeTemporaryDtors: false -User: cnihelton -CheckOptions: - - key: cert-err61-cpp.CheckThrowTemporaries - value: '1' - - key: cert-oop11-cpp.IncludeStyle - value: llvm - - key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader - value: '' - - key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle - value: '1' - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: misc-definitions-in-headers.UseHeaderFileExtension - value: '1' - - key: misc-move-constructor-init.IncludeStyle - value: llvm - - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries - value: '1' - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: readability-braces-around-statements.ShortStatementLines - value: '0' - - key: readability-function-size.BranchThreshold - value: '4294967295' - - key: readability-function-size.LineThreshold - value: '4294967295' - - key: readability-function-size.StatementThreshold - value: '800' - - key: readability-identifier-naming.AbstractClassCase - value: aNy_CasE - - key: readability-identifier-naming.AbstractClassPrefix - value: '' - - key: readability-identifier-naming.AbstractClassSuffix - value: '' - - key: readability-identifier-naming.ClassCase - value: aNy_CasE - - key: readability-identifier-naming.ClassConstantCase - value: aNy_CasE - - key: readability-identifier-naming.ClassConstantPrefix - value: '' - - key: readability-identifier-naming.ClassConstantSuffix - value: '' - - key: readability-identifier-naming.ClassMemberCase - value: aNy_CasE - - key: readability-identifier-naming.ClassMemberPrefix - value: '' - - key: readability-identifier-naming.ClassMemberSuffix - value: '' - - key: readability-identifier-naming.ClassMethodCase - value: aNy_CasE - - key: readability-identifier-naming.ClassMethodPrefix - value: '' - - key: readability-identifier-naming.ClassMethodSuffix - value: '' - - key: readability-identifier-naming.ClassPrefix - value: '' - - key: readability-identifier-naming.ClassSuffix - value: '' - - key: readability-identifier-naming.ConstantCase - value: aNy_CasE - - key: readability-identifier-naming.ConstantMemberCase - value: aNy_CasE - - key: readability-identifier-naming.ConstantMemberPrefix - value: '' - - key: readability-identifier-naming.ConstantMemberSuffix - value: '' - - key: readability-identifier-naming.ConstantParameterCase - value: aNy_CasE - - key: readability-identifier-naming.ConstantParameterPrefix - value: '' - - key: readability-identifier-naming.ConstantParameterSuffix - value: '' - - key: readability-identifier-naming.ConstantPrefix - value: '' - - key: readability-identifier-naming.ConstantSuffix - value: '' - - key: readability-identifier-naming.ConstexprFunctionCase - value: aNy_CasE - - key: readability-identifier-naming.ConstexprFunctionPrefix - value: '' - - key: readability-identifier-naming.ConstexprFunctionSuffix - value: '' - - key: readability-identifier-naming.ConstexprMethodCase - value: aNy_CasE - - key: readability-identifier-naming.ConstexprMethodPrefix - value: '' - - key: readability-identifier-naming.ConstexprMethodSuffix - value: '' - - key: readability-identifier-naming.ConstexprVariableCase - value: aNy_CasE - - key: readability-identifier-naming.ConstexprVariablePrefix - value: '' - - key: readability-identifier-naming.ConstexprVariableSuffix - value: '' - - key: readability-identifier-naming.EnumCase - value: aNy_CasE - - key: readability-identifier-naming.EnumConstantCase - value: aNy_CasE - - key: readability-identifier-naming.EnumConstantPrefix - value: '' - - key: readability-identifier-naming.EnumConstantSuffix - value: '' - - key: readability-identifier-naming.EnumPrefix - value: '' - - key: readability-identifier-naming.EnumSuffix - value: '' - - key: readability-identifier-naming.FunctionCase - value: aNy_CasE - - key: readability-identifier-naming.FunctionPrefix - value: '' - - key: readability-identifier-naming.FunctionSuffix - value: '' - - key: readability-identifier-naming.GlobalConstantCase - value: aNy_CasE - - key: readability-identifier-naming.GlobalConstantPrefix - value: '' - - key: readability-identifier-naming.GlobalConstantSuffix - value: '' - - key: readability-identifier-naming.GlobalFunctionCase - value: aNy_CasE - - key: readability-identifier-naming.GlobalFunctionPrefix - value: '' - - key: readability-identifier-naming.GlobalFunctionSuffix - value: '' - - key: readability-identifier-naming.GlobalVariableCase - value: aNy_CasE - - key: readability-identifier-naming.GlobalVariablePrefix - value: '' - - key: readability-identifier-naming.GlobalVariableSuffix - value: '' - - key: readability-identifier-naming.IgnoreFailedSplit - value: '0' - - key: readability-identifier-naming.InlineNamespaceCase - value: aNy_CasE - - key: readability-identifier-naming.InlineNamespacePrefix - value: '' - - key: readability-identifier-naming.InlineNamespaceSuffix - value: '' - - key: readability-identifier-naming.LocalConstantCase - value: aNy_CasE - - key: readability-identifier-naming.LocalConstantPrefix - value: '' - - key: readability-identifier-naming.LocalConstantSuffix - value: '' - - key: readability-identifier-naming.LocalVariableCase - value: aNy_CasE - - key: readability-identifier-naming.LocalVariablePrefix - value: '' - - key: readability-identifier-naming.LocalVariableSuffix - value: '' - - key: readability-identifier-naming.MemberCase - value: aNy_CasE - - key: readability-identifier-naming.MemberPrefix - value: '' - - key: readability-identifier-naming.MemberSuffix - value: '' - - key: readability-identifier-naming.MethodCase - value: aNy_CasE - - key: readability-identifier-naming.MethodPrefix - value: '' - - key: readability-identifier-naming.MethodSuffix - value: '' - - key: readability-identifier-naming.NamespaceCase - value: aNy_CasE - - key: readability-identifier-naming.NamespacePrefix - value: '' - - key: readability-identifier-naming.NamespaceSuffix - value: '' - - key: readability-identifier-naming.ParameterCase - value: aNy_CasE - - key: readability-identifier-naming.ParameterPackCase - value: aNy_CasE - - key: readability-identifier-naming.ParameterPackPrefix - value: '' - - key: readability-identifier-naming.ParameterPackSuffix - value: '' - - key: readability-identifier-naming.ParameterPrefix - value: '' - - key: readability-identifier-naming.ParameterSuffix - value: '' - - key: readability-identifier-naming.PrivateMemberCase - value: aNy_CasE - - key: readability-identifier-naming.PrivateMemberPrefix - value: '' - - key: readability-identifier-naming.PrivateMemberSuffix - value: '' - - key: readability-identifier-naming.PrivateMethodCase - value: aNy_CasE - - key: readability-identifier-naming.PrivateMethodPrefix - value: '' - - key: readability-identifier-naming.PrivateMethodSuffix - value: '' - - key: readability-identifier-naming.ProtectedMemberCase - value: aNy_CasE - - key: readability-identifier-naming.ProtectedMemberPrefix - value: '' - - key: readability-identifier-naming.ProtectedMemberSuffix - value: '' - - key: readability-identifier-naming.ProtectedMethodCase - value: aNy_CasE - - key: readability-identifier-naming.ProtectedMethodPrefix - value: '' - - key: readability-identifier-naming.ProtectedMethodSuffix - value: '' - - key: readability-identifier-naming.PublicMemberCase - value: aNy_CasE - - key: readability-identifier-naming.PublicMemberPrefix - value: '' - - key: readability-identifier-naming.PublicMemberSuffix - value: '' - - key: readability-identifier-naming.PublicMethodCase - value: aNy_CasE - - key: readability-identifier-naming.PublicMethodPrefix - value: '' - - key: readability-identifier-naming.PublicMethodSuffix - value: '' - - key: readability-identifier-naming.StaticConstantCase - value: aNy_CasE - - key: readability-identifier-naming.StaticConstantPrefix - value: '' - - key: readability-identifier-naming.StaticConstantSuffix - value: '' - - key: readability-identifier-naming.StaticVariableCase - value: aNy_CasE - - key: readability-identifier-naming.StaticVariablePrefix - value: '' - - key: readability-identifier-naming.StaticVariableSuffix - value: '' - - key: readability-identifier-naming.StructCase - value: aNy_CasE - - key: readability-identifier-naming.StructPrefix - value: '' - - key: readability-identifier-naming.StructSuffix - value: '' - - key: readability-identifier-naming.TemplateParameterCase - value: aNy_CasE - - key: readability-identifier-naming.TemplateParameterPrefix - value: '' - - key: readability-identifier-naming.TemplateParameterSuffix - value: '' - - key: readability-identifier-naming.TemplateTemplateParameterCase - value: aNy_CasE - - key: readability-identifier-naming.TemplateTemplateParameterPrefix - value: '' - - key: readability-identifier-naming.TemplateTemplateParameterSuffix - value: '' - - key: readability-identifier-naming.TypeTemplateParameterCase - value: aNy_CasE - - key: readability-identifier-naming.TypeTemplateParameterPrefix - value: '' - - key: readability-identifier-naming.TypeTemplateParameterSuffix - value: '' - - key: readability-identifier-naming.TypedefCase - value: aNy_CasE - - key: readability-identifier-naming.TypedefPrefix - value: '' - - key: readability-identifier-naming.TypedefSuffix - value: '' - - key: readability-identifier-naming.UnionCase - value: aNy_CasE - - key: readability-identifier-naming.UnionPrefix - value: '' - - key: readability-identifier-naming.UnionSuffix - value: '' - - key: readability-identifier-naming.ValueTemplateParameterCase - value: aNy_CasE - - key: readability-identifier-naming.ValueTemplateParameterPrefix - value: '' - - key: readability-identifier-naming.ValueTemplateParameterSuffix - value: '' - - key: readability-identifier-naming.VariableCase - value: aNy_CasE - - key: readability-identifier-naming.VariablePrefix - value: '' - - key: readability-identifier-naming.VariableSuffix - value: '' - - key: readability-identifier-naming.VirtualMethodCase - value: aNy_CasE - - key: readability-identifier-naming.VirtualMethodPrefix - value: '' - - key: readability-identifier-naming.VirtualMethodSuffix - value: '' - - key: readability-simplify-boolean-expr.ChainedConditionalAssignment - value: '0' - - key: readability-simplify-boolean-expr.ChainedConditionalReturn - value: '0' -... diff --git a/plugins/clangtidy/.gitignore b/plugins/clangtidy/.gitignore deleted file mode 100644 index 8effe94e63..0000000000 --- a/plugins/clangtidy/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.kdev4 -*kdev4 -build -*.yaml -!tests/data/* diff --git a/plugins/clangtidy/CMakeLists.txt b/plugins/clangtidy/CMakeLists.txt index ddbe9123fb..18a341f859 100644 --- a/plugins/clangtidy/CMakeLists.txt +++ b/plugins/clangtidy/CMakeLists.txt @@ -1,90 +1,81 @@ -cmake_minimum_required(VERSION 3.0) - -project(kdev-clangtidy) - -find_package (ECM "5.14.0" REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) - -include(KDECompilerSettings NO_POLICY_SCOPE) -include(ECMAddTests) -include(ECMQtDeclareLoggingCategory) -include(KDEInstallDirs) -include(KDECMakeSettings) -include(FeatureSummary) - -if(BUILD_TESTING) - set(QT_ADDITIONAL_REQ_COMPONENTS Test) -endif() -set(QT_MIN_VERSION "5.5.0") -find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED - Core - Widgets - ${QT_ADDITIONAL_REQ_COMPONENTS} -) - -set(KF5_DEP_VERSION "5.15.0") -# TRUE needed because missing in KDevPlatformConfig.cmake, remove TRUE once dep on kdevplatform >=5.2.2 -if(Qt5_VERSION VERSION_LESS "5.10.0" OR TRUE) - set(KF_ADDITIONAL_REQ_COMPONENTS ItemModels) -endif() -find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS - I18n - ItemViews - Config - ${KF_ADDITIONAL_REQ_COMPONENTS} -) -set(KDEVPLATFORM_DEP_VERSION "5.2.0") -find_package(KDevPlatform ${KDEVPLATFORM_DEP_VERSION} CONFIG) -set_package_properties(KDevPlatform PROPERTIES - TYPE REQUIRED -) -if(BUILD_TESTING) - if (NOT TARGET KDev::Tests) - message(FATAL_ERROR "KDevPlatform was built without the library KDevPlatformTests (due to BUILD_TESTING=OFF), which though is required for our tests.") - endif() -endif() - -find_package(Boost REQUIRED) +add_definitions(-DTRANSLATION_DOMAIN=\"kdevclangtidy\") find_package(ClangTidy QUIET) set_package_properties(ClangTidy PROPERTIES DESCRIPTION "A clang-based C++ “linter” tool" URL "http://clang.llvm.org/extra/clang-tidy/" TYPE RUNTIME ) -add_definitions( - -DQT_DEPRECATED_WARNINGS - -DQT_DISABLE_DEPRECATED_BEFORE=0x050500 - -DQT_NO_SIGNALS_SLOTS_KEYWORDS - -DQT_NO_URL_CAST_FROM_STRING - -DQT_STRICT_ITERATORS - -DQT_USE_QSTRINGBUILDER - -DQT_NO_CAST_FROM_ASCII - -DQT_NO_CAST_TO_ASCII - -DQT_NO_CAST_FROM_BYTEARRAY - -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -) - -include (cmake/ClangFormatAll.cmake) - include_directories( - ${CMAKE_CURRENT_BINARY_DIR} + ${Boost_INCLUDE_DIRS} ) ecm_qt_declare_logging_category(kdevclangtidy_LOG_SRCS HEADER debug.h IDENTIFIER KDEV_CLANGTIDY - CATEGORY_NAME "kdevelop.analyzers.clangtidy" + CATEGORY_NAME "kdevelop.plugins.clangtidy" ) -add_subdirectory(src) +set(kdevclangtidy_PART_SRCS + ${kdevclangtidy_LOG_SRCS} + + job.cpp + plugin.cpp + checkset.cpp + problemmodel.cpp + utils.cpp + + config/clangtidyprojectconfigpage.cpp + config/clangtidypreferences.cpp + config/checkselection.cpp + config/checklistfilterproxysearchline.cpp + config/checklistitemproxystyle.cpp + config/checklistmodel.cpp + config/checkgroup.cpp + + parsers/clangtidyparser.cpp +# disable for now: +# CentOS used for appimage does not have string_ref.hpp (Boost >= 1.53) as used by current code +# parsers/replacementparser.cpp +) + +ki18n_wrap_ui(kdevclangtidy_PART_SRCS + config/clangtidypreferences.ui + config/clangtidyprojectconfigpage.ui +) + +qt5_add_resources(kdevclangtidy_PART_SRCS + kdevclangtidy.qrc +) + +kconfig_add_kcfg_files(kdevclangtidy_PART_SRCS + config/clangtidyconfig.kcfgc + config/clangtidyprojectconfig.kcfgc +) + +kdevplatform_add_plugin(kdevclangtidy + JSON kdevclangtidy.json + SOURCES ${kdevclangtidy_PART_SRCS} +) + +target_link_libraries(kdevclangtidy + KDev::Interfaces + KDev::Project + KDev::Language + KDev::OutputView + KDev::Util + KDev::Shell + KF5::ItemViews + KF5::ConfigCore + KF5::I18n +) +if(Qt5_VERSION VERSION_LESS "5.10.0") +target_link_libraries(kdevclangtidy + KF5::ItemModels +) +endif() if(BUILD_TESTING) add_subdirectory(tests) endif() - -# kdebugsettings file -install(FILES kdevclangtidy.categories DESTINATION ${KDE_INSTALL_CONFDIR}) - -feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/plugins/clangtidy/COPYING b/plugins/clangtidy/COPYING deleted file mode 100644 index c13faf0dd8..0000000000 --- a/plugins/clangtidy/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/plugins/clangtidy/Messages.sh b/plugins/clangtidy/Messages.sh new file mode 100644 index 0000000000..5db6712f52 --- /dev/null +++ b/plugins/clangtidy/Messages.sh @@ -0,0 +1,4 @@ +#! /usr/bin/env bash +$EXTRACTRC `find . -name \*.rc -o -name \*.ui | grep -v '/tests/'` >> rc.cpp +$XGETTEXT `find . -name \*.cpp -o -name \*.h | grep -v '/tests/'` -o $podir/kdevclangtidy.pot +rm -f rc.cpp diff --git a/plugins/clangtidy/README.md b/plugins/clangtidy/README.md deleted file mode 100644 index aeac952518..0000000000 --- a/plugins/clangtidy/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# kdev-clang-tidy - -A plugin for [KDevelop](https://www.kdevelop.org) to support [Clang-Tidy](http://clang.llvm.org/extra/clang-tidy/) static analysis. -It uses the [KDevelop5 Problem Checker Framework](https://techbase.kde.org/KDevelop5/Problem_Checker_Framework), parsing clang-tidy's output and showing the issues on the Problems Viewer, allowing easy review of the code. - -The plugin provides some very basic features for the start: - -* running clang-tidy on a single file, subdirectories or the whole project, - with the result shown in the Problems tool view, - invokable from file context menus and main menu (Analyzer section) -* per-project config UI: - * free field for additional command line parameters to clang-tidy - * checkbox whether to include system headers in the check - * toggle between using .clang-tidy files or options in the config UI: - * header filter regular expression - * opt-in list of checks - -See below what might be coming next. - -## Get It - -Either build it yourself from the sources (see below). - -Or search the package manager of your Linux distribution or *BSD system for it (e.g. kdevelop-clang-tidy or kdev-clang-tidy): - -* Arch Linux: kdevelop-clang-tidy -* Gentoo: kdevelop-clang-tidy -* openSUSE: kdevelop5-plugin-clang-tidy -* (please report the name in your package system/distribution, so it can be listed here). - -Or try to install it via its [AppStream Id Link](appstream://org.kde.kdev-clang-tidy) - - -## Use It - -Once installed, open the global KDevelop settings: ensure in the "Plugins" page that the "Clang-Tidy Support" plugin is enabled, then in the "Analyzers"/"Clang-Tidy" page make sure the clang-tidy executable path points to an existing executable. - -Next open the configuration dialog for a project and check the settings in the "Clang-Tidy" page. - -Then open a C++ source file of your project. Now invoke a run of clang-tidy either via the main menu "Code"/"Analyze Current File With"/"Analyze Current File With Clang-Tidy" or via the context menu on the file "Analyze Current File With"/"Clang-Tidy". A job should be started and, once finished, the "Problems" tool view should show up with the page "Clang-Tidy" selected, listing the result of the run. - -**NOTE:** -For now one has to enable oneself the creation of the so-called compilation database which clang-tidy uses, e.g. with CMake to set the flag `CMAKE_EXPORT_COMPILE_COMMANDS` to `ON` -in the settings (listed under "Advanced values" in the project's CMake settings in KDevelop). The plugin does not (yet) handle that for you. - - -## Report Bugs & Feature Requests - -Tell what issues you have or would like to see at the [KDE bug tracker, product "KDevelop", component "Analyzer: Clang-Tidy"](https://bugs.kde.org/enter_bug.cgi?format=guided&product=kdevelop&component=Analyzer:%20Clang-Tidy) - - -## Package and Distribute It - -The sources of this plugin build against the current stable KDevelop version, 5.2 (and also master). The result will only work with the version built against (5.2 or master). - -Download tarballs of released versions from https://download.kde.org/stable/kdev-clang-tidy - -Best create packages like you do from the tarballs of other separate KDevelop plugins, like kdev-python & kdev-php (which are released in the official KDevelop release bundle). - -See also notes about building below. - -## Build and Install It - -Building the sources is done with CMake as build confguration tool, the usual things apply. - -Requirement for building are the development files/package of KDevPlatform, at least version 5.2. - -To have the KDevelop application see the new plugin, there are multiple options: - -* the plugin either needs to be installed to the installation prefix where kdevelop is installed (e.g. using CMake flag `-DCMAKE_INSTALL_PREFIX="/usr"` with a kdevelop as installed from packages typically). -* the kdevelop instances need to be informed about the custom plugin install directory by seeing the environment variable `QT_PLUGIN_PATH` which is set to also includes the base path to the plugin, i.e. from where `kdevplatform//kdevclangtidy.so` is found (e.g. having in the `.bashrc` file a line `export QT_PLUGIN_PATH=$HOME/opt/kdevelop/lib64/plugins:$QT_PLUGIN_PATH` if the CMake flag `-DCMAKE_INSTALL_PREFIX=$HOME/opt/kdevelop` was used and if `lib64` is the system's library subdir name). - -**NOTE:** -Set the CMake flag -DBUILD_TESTING=OFF if kdevelop has been built with that flag value. - - -## Learn What is on the Development Road - -Planned features (in rough order of execution): - -* warning about missing compilation database -* support for fix-its -* globally defined sets of checks, for reuse between projects and use for - specific code analyze work -* folder-specific clang-tidy settings -* being an editor for .clang-tidy files, for seamless integration between - IDE-based and console-based usage of clang-tidy -* enabling the generation of compilation database by simple button when needed - -Long term the kdev-clang-tidy plugin should be added to the kdevelop code repository, as planned before (cmp. [KDevelop 5.1 release notes](https://www.kdevelop.org/news/kdevelop-510-released) ). - -Even better though would be somebody implementing integration of this and other clang-based analyzers directly with the clang-parser of the KDevelop clang-based language plugin, so any warnings and fix-its are delivered as part of the normal editing. Though this might be more challenging, so the current explicit analyzer plugins serve as intermediate utilities. - -## Get in Contact - -This plugin is currently developed by KDevelop contributors, who can be reached via the usual [KDevelop support channels](https://www.kdevelop.org/support). diff --git a/plugins/clangtidy/src/checkset.cpp b/plugins/clangtidy/checkset.cpp similarity index 100% rename from plugins/clangtidy/src/checkset.cpp rename to plugins/clangtidy/checkset.cpp diff --git a/plugins/clangtidy/src/checkset.h b/plugins/clangtidy/checkset.h similarity index 100% rename from plugins/clangtidy/src/checkset.h rename to plugins/clangtidy/checkset.h diff --git a/plugins/clangtidy/cmake/ClangFormatAll.cmake b/plugins/clangtidy/cmake/ClangFormatAll.cmake deleted file mode 100644 index 28fb4799f5..0000000000 --- a/plugins/clangtidy/cmake/ClangFormatAll.cmake +++ /dev/null @@ -1,18 +0,0 @@ - -file(GLOB_RECURSE ALL_SOURCE_FILES - src/*/*.cpp - src/*/*.h - tests/*.cpp - tests/*.h - ) - -find_program (CLANG_FMT_CMD - NAMES "clang-format" - ) -if(NOT CLANG_FMT_CMD) - message(WARNING "clang-format not found!") -else() - add_custom_target( ClangFormatAll - COMMAND ${CLANG_FMT_CMD} -style=file -i ${ALL_SOURCE_FILES} - ) -endif() diff --git a/plugins/clangtidy/src/config/checkgroup.cpp b/plugins/clangtidy/config/checkgroup.cpp similarity index 100% rename from plugins/clangtidy/src/config/checkgroup.cpp rename to plugins/clangtidy/config/checkgroup.cpp diff --git a/plugins/clangtidy/src/config/checkgroup.h b/plugins/clangtidy/config/checkgroup.h similarity index 100% rename from plugins/clangtidy/src/config/checkgroup.h rename to plugins/clangtidy/config/checkgroup.h diff --git a/plugins/clangtidy/src/config/checklistfilterproxysearchline.cpp b/plugins/clangtidy/config/checklistfilterproxysearchline.cpp similarity index 100% rename from plugins/clangtidy/src/config/checklistfilterproxysearchline.cpp rename to plugins/clangtidy/config/checklistfilterproxysearchline.cpp diff --git a/plugins/clangtidy/src/config/checklistfilterproxysearchline.h b/plugins/clangtidy/config/checklistfilterproxysearchline.h similarity index 100% rename from plugins/clangtidy/src/config/checklistfilterproxysearchline.h rename to plugins/clangtidy/config/checklistfilterproxysearchline.h diff --git a/plugins/clangtidy/src/config/checklistitemproxystyle.cpp b/plugins/clangtidy/config/checklistitemproxystyle.cpp similarity index 100% rename from plugins/clangtidy/src/config/checklistitemproxystyle.cpp rename to plugins/clangtidy/config/checklistitemproxystyle.cpp diff --git a/plugins/clangtidy/src/config/checklistitemproxystyle.h b/plugins/clangtidy/config/checklistitemproxystyle.h similarity index 100% rename from plugins/clangtidy/src/config/checklistitemproxystyle.h rename to plugins/clangtidy/config/checklistitemproxystyle.h diff --git a/plugins/clangtidy/src/config/checklistmodel.cpp b/plugins/clangtidy/config/checklistmodel.cpp similarity index 100% rename from plugins/clangtidy/src/config/checklistmodel.cpp rename to plugins/clangtidy/config/checklistmodel.cpp diff --git a/plugins/clangtidy/src/config/checklistmodel.h b/plugins/clangtidy/config/checklistmodel.h similarity index 100% rename from plugins/clangtidy/src/config/checklistmodel.h rename to plugins/clangtidy/config/checklistmodel.h diff --git a/plugins/clangtidy/src/config/checkselection.cpp b/plugins/clangtidy/config/checkselection.cpp similarity index 100% rename from plugins/clangtidy/src/config/checkselection.cpp rename to plugins/clangtidy/config/checkselection.cpp diff --git a/plugins/clangtidy/src/config/checkselection.h b/plugins/clangtidy/config/checkselection.h similarity index 100% rename from plugins/clangtidy/src/config/checkselection.h rename to plugins/clangtidy/config/checkselection.h diff --git a/plugins/clangtidy/src/config/clangtidyconfig.kcfg b/plugins/clangtidy/config/clangtidyconfig.kcfg similarity index 100% rename from plugins/clangtidy/src/config/clangtidyconfig.kcfg rename to plugins/clangtidy/config/clangtidyconfig.kcfg diff --git a/plugins/clangtidy/src/config/clangtidyconfig.kcfgc b/plugins/clangtidy/config/clangtidyconfig.kcfgc similarity index 100% rename from plugins/clangtidy/src/config/clangtidyconfig.kcfgc rename to plugins/clangtidy/config/clangtidyconfig.kcfgc diff --git a/plugins/clangtidy/src/config/clangtidypreferences.cpp b/plugins/clangtidy/config/clangtidypreferences.cpp similarity index 100% rename from plugins/clangtidy/src/config/clangtidypreferences.cpp rename to plugins/clangtidy/config/clangtidypreferences.cpp diff --git a/plugins/clangtidy/src/config/clangtidypreferences.h b/plugins/clangtidy/config/clangtidypreferences.h similarity index 100% rename from plugins/clangtidy/src/config/clangtidypreferences.h rename to plugins/clangtidy/config/clangtidypreferences.h diff --git a/plugins/clangtidy/src/config/clangtidypreferences.ui b/plugins/clangtidy/config/clangtidypreferences.ui similarity index 100% rename from plugins/clangtidy/src/config/clangtidypreferences.ui rename to plugins/clangtidy/config/clangtidypreferences.ui diff --git a/plugins/clangtidy/src/config/clangtidyprojectconfig.kcfg b/plugins/clangtidy/config/clangtidyprojectconfig.kcfg similarity index 100% rename from plugins/clangtidy/src/config/clangtidyprojectconfig.kcfg rename to plugins/clangtidy/config/clangtidyprojectconfig.kcfg diff --git a/plugins/clangtidy/src/config/clangtidyprojectconfig.kcfgc b/plugins/clangtidy/config/clangtidyprojectconfig.kcfgc similarity index 100% rename from plugins/clangtidy/src/config/clangtidyprojectconfig.kcfgc rename to plugins/clangtidy/config/clangtidyprojectconfig.kcfgc diff --git a/plugins/clangtidy/src/config/clangtidyprojectconfigpage.cpp b/plugins/clangtidy/config/clangtidyprojectconfigpage.cpp similarity index 100% rename from plugins/clangtidy/src/config/clangtidyprojectconfigpage.cpp rename to plugins/clangtidy/config/clangtidyprojectconfigpage.cpp diff --git a/plugins/clangtidy/src/config/clangtidyprojectconfigpage.h b/plugins/clangtidy/config/clangtidyprojectconfigpage.h similarity index 100% rename from plugins/clangtidy/src/config/clangtidyprojectconfigpage.h rename to plugins/clangtidy/config/clangtidyprojectconfigpage.h diff --git a/plugins/clangtidy/src/config/clangtidyprojectconfigpage.ui b/plugins/clangtidy/config/clangtidyprojectconfigpage.ui similarity index 100% rename from plugins/clangtidy/src/config/clangtidyprojectconfigpage.ui rename to plugins/clangtidy/config/clangtidyprojectconfigpage.ui diff --git a/plugins/clangtidy/format.config.uncrustify.4_spaces b/plugins/clangtidy/format.config.uncrustify.4_spaces deleted file mode 100644 index e4edb39b1a..0000000000 --- a/plugins/clangtidy/format.config.uncrustify.4_spaces +++ /dev/null @@ -1,161 +0,0 @@ -set for foreach - -align_func_params=false -align_keep_tabs=false -align_left_shift=true -align_mix_var_proto=false -align_nl_cont=false -align_number_left=false -align_on_operator=false -align_on_tabstop=false -align_right_cmt_mix=false -align_same_func_call_params=false -align_single_line_brace=false -align_single_line_func=false -align_var_def_attribute=false -align_var_def_colon=false -align_var_def_inline=false -align_with_tabs=false -cmt_c_group=false -cmt_c_nl_end=false -cmt_c_nl_start=false -cmt_cpp_group=false -cmt_cpp_nl_end=false -cmt_cpp_nl_start=false -cmt_cpp_to_c=false -cmt_indent_multi=true -cmt_insert_before_preproc=false -cmt_multi_check_last=true -cmt_star_cont=false -eat_blanks_after_open_brace=true -eat_blanks_before_close_brace=true -indent_access_spec_body=false -indent_align_assign=true -indent_align_string=false -indent_bool_paren=false -indent_brace_parent=false -indent_braces=false -indent_braces_no_func=false -indent_class_colon=false -indent_class=true -indent_col1_comment=false -indent_columns=4 -indent_comma_paren=false -indent_else_if=false -indent_extern=false -indent_func_call_param=false -indent_func_class_param=false -indent_func_ctor_var_param=true -indent_func_def_param=false -indent_func_param_double=false -indent_func_proto_param=false -indent_namespace=false -indent_paren_nl=false -indent_preserve_sql=false -indent_relative_single_line_comments=false -indent_square_nl=false -indent_switch_case=0 -indent_template_param=true -indent_with_tabs=0 -ls_for_split_full=false -ls_func_split_full=false -mod_add_long_ifdef_else_comment=0 -mod_add_long_ifdef_endif_comment=0 -mod_full_brace_do=add -mod_full_brace_for=add -mod_full_brace_function=add -mod_full_brace_if=add -mod_full_paren_if_bool=false -mod_move_case_break=false -mod_pawn_semicolon=false -mod_remove_empty_return=false -mod_remove_extra_semicolon=false -mod_sort_import=false -mod_sort_include=false -mod_sort_using=false -nl_after_access_spec=0 -nl_after_brace_open=true -nl_after_for=add -nl_after_multiline_comment=false -nl_after_vbrace_open=true -nl_assign_leave_one_liners=true -nl_before_access_spec=1 -nl_before_case=false -nl_brace_else=remove -nl_class_brace=add -nl_class_brace=force -nl_class_colon=add -nl_class_init_args=add -nl_class_leave_one_liners=true -nl_collapse_empty_body=false -nl_constr_init_args=add -nl_create_for_one_liner=false -nl_create_if_one_liner=false -nl_create_while_one_liner=false -nl_define_macro=false -nl_ds_struct_enum_close_brace=false -nl_ds_struct_enum_cmt=false -nl_elseif_brace=remove -nl_enum_leave_one_liners=true -nl_fdef_brace=add -nl_for_brace=remove -nl_func_leave_one_liners=true -nl_getset_leave_one_liners=true -nl_if_brace=remove -nl_max=2 -nl_multi_line_cond=false -nl_multi_line_define=false -nl_namespace_brace=remove -nl_squeeze_ifdef=false -nl_struct_brace=force -nl_while_brace=remove -pos_class_colon=lead_force -pos_class_comma=lead_force -pos_comma=trail -pos_constr_comma=lead_force -pp_define_at_level=false -pp_if_indent_code=false -pp_indent_at_level=false -pp_region_indent_code=false -sp_after_angle=add -sp_after_assign=add -sp_after_byref=add -sp_after_class_colon=add -sp_after_comma=add -sp_after_ptr_star=add -sp_after_sparen=remove -sp_arith=add -sp_assign=add -sp_assign_default=add -sp_balance_nested_parens=false -sp_before_assign=add -sp_before_byref=remove -sp_before_case_colon=remove -sp_before_class_colon=add -sp_before_comma=remove -sp_before_ptr_star=remove -sp_before_sparen=add -sp_bool=add -sp_brace_else=add -sp_compare=add -sp_else_brace=add -sp_enum_after_assign=add -sp_enum_assign=add -sp_enum_before_assign=add -sp_fparen_brace=add -sp_func_call_paren=remove -sp_func_def_paren=remove -sp_inside_angle=remove -sp_inside_fparen=remove -sp_inside_fparens=remove -sp_inside_paren_cast=add -sp_inside_paren=remove -sp_inside_sparen=remove -sp_inside_square=remove -sp_paren_brace=add -sp_paren_paren=remove -sp_pp_concat=add -sp_pp_stringify=add -sp_sparen_brace=add -sp_square_fparen=remove -sp_template_angle=add diff --git a/plugins/clangtidy/format_sources b/plugins/clangtidy/format_sources deleted file mode 100644 index 5e70a5cd54..0000000000 --- a/plugins/clangtidy/format_sources +++ /dev/null @@ -1,2 +0,0 @@ -# Default: 4-space indentation -* : uncrustify -l CPP -f $TMPFILE -c format.config.uncrustify.4_spaces -o $TMPFILE diff --git a/plugins/clangtidy/src/job.cpp b/plugins/clangtidy/job.cpp similarity index 100% rename from plugins/clangtidy/src/job.cpp rename to plugins/clangtidy/job.cpp diff --git a/plugins/clangtidy/src/job.h b/plugins/clangtidy/job.h similarity index 100% rename from plugins/clangtidy/src/job.h rename to plugins/clangtidy/job.h diff --git a/plugins/clangtidy/kdev-clang-tidy.kdev4 b/plugins/clangtidy/kdev-clang-tidy.kdev4 deleted file mode 100644 index 1df9463fe0..0000000000 --- a/plugins/clangtidy/kdev-clang-tidy.kdev4 +++ /dev/null @@ -1,4 +0,0 @@ -[Project] -CreatedFrom=CMakeLists.txt -Manager=KDevCMakeManager -Name=kdev-clang-tidy diff --git a/plugins/clangtidy/kdevclangtidy.categories b/plugins/clangtidy/kdevclangtidy.categories deleted file mode 100644 index cbc22ab7af..0000000000 --- a/plugins/clangtidy/kdevclangtidy.categories +++ /dev/null @@ -1,5 +0,0 @@ -# KDebugSettings data file -# Format: -# lognamedescription - -kdevelop.analyzers.clangtidy KDevelop plugin: clangtidy diff --git a/plugins/clangtidy/src/kdevclangtidy.json b/plugins/clangtidy/kdevclangtidy.json similarity index 100% rename from plugins/clangtidy/src/kdevclangtidy.json rename to plugins/clangtidy/kdevclangtidy.json diff --git a/plugins/clangtidy/src/kdevclangtidy.qrc b/plugins/clangtidy/kdevclangtidy.qrc similarity index 100% rename from plugins/clangtidy/src/kdevclangtidy.qrc rename to plugins/clangtidy/kdevclangtidy.qrc diff --git a/plugins/clangtidy/src/kdevclangtidy.rc b/plugins/clangtidy/kdevclangtidy.rc similarity index 100% rename from plugins/clangtidy/src/kdevclangtidy.rc rename to plugins/clangtidy/kdevclangtidy.rc diff --git a/plugins/clangtidy/src/parsers/clangtidyparser.cpp b/plugins/clangtidy/parsers/clangtidyparser.cpp similarity index 100% rename from plugins/clangtidy/src/parsers/clangtidyparser.cpp rename to plugins/clangtidy/parsers/clangtidyparser.cpp diff --git a/plugins/clangtidy/src/parsers/clangtidyparser.h b/plugins/clangtidy/parsers/clangtidyparser.h similarity index 100% rename from plugins/clangtidy/src/parsers/clangtidyparser.h rename to plugins/clangtidy/parsers/clangtidyparser.h diff --git a/plugins/clangtidy/src/parsers/replacementparser.cpp b/plugins/clangtidy/parsers/replacementparser.cpp similarity index 100% rename from plugins/clangtidy/src/parsers/replacementparser.cpp rename to plugins/clangtidy/parsers/replacementparser.cpp diff --git a/plugins/clangtidy/src/parsers/replacementparser.h b/plugins/clangtidy/parsers/replacementparser.h similarity index 100% rename from plugins/clangtidy/src/parsers/replacementparser.h rename to plugins/clangtidy/parsers/replacementparser.h diff --git a/plugins/clangtidy/src/plugin.cpp b/plugins/clangtidy/plugin.cpp similarity index 100% rename from plugins/clangtidy/src/plugin.cpp rename to plugins/clangtidy/plugin.cpp diff --git a/plugins/clangtidy/src/plugin.h b/plugins/clangtidy/plugin.h similarity index 100% rename from plugins/clangtidy/src/plugin.h rename to plugins/clangtidy/plugin.h diff --git a/plugins/clangtidy/src/problemmodel.cpp b/plugins/clangtidy/problemmodel.cpp similarity index 96% rename from plugins/clangtidy/src/problemmodel.cpp rename to plugins/clangtidy/problemmodel.cpp index 71a9163ecb..b044c253f6 100644 --- a/plugins/clangtidy/src/problemmodel.cpp +++ b/plugins/clangtidy/problemmodel.cpp @@ -1,141 +1,135 @@ /* * This file is part of KDevelop * * Copyright 2018 Anton Anikin * Copyright 2018 Friedrich W. H. Kossebau * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #include "problemmodel.h" // plugin #include "utils.h" #include "plugin.h" #include "qtcompat_p.h" // KDevPlatform #include #include // KF #include namespace ClangTidy { ProblemModel::ProblemModel(Plugin* plugin, QObject* parent) : KDevelop::ProblemModel(parent) , m_plugin(plugin) { setFeatures(CanDoFullUpdate | ScopeFilter | SeverityFilter | Grouping | CanByPassScopeFilter); } ProblemModel::~ProblemModel() = default; void ProblemModel::forceFullUpdate() { if (m_url.isValid() && !m_plugin->isRunning()) { m_plugin->runClangTidy(m_url, m_allFiles); } } void ProblemModel::reset(KDevelop::IProject* project, const QUrl& url, bool allFiles) { m_url = url; m_allFiles = allFiles; const auto path = url.toLocalFile(); clearProblems(); m_problems.clear(); QString tooltip; if (project) { -#if HAVE_PROBLEMMODEL_SETPLACEHOLDERTEXT setMessage(i18n("Analysis started...")); -#endif tooltip = i18nc("@info:tooltip %1 is the path of the file", "Re-run last Clang-Tidy analysis (%1)", Utils::prettyPathName(path)); } else { tooltip = i18nc("@info:tooltip", "Re-run last Clang-Tidy analysis"); } setFullUpdateTooltip(tooltip); } -#if HAVE_PROBLEMMODEL_SETPLACEHOLDERTEXT void ProblemModel::setMessage(const QString& message) { KDevelop::DocumentRange pathLocation(KDevelop::DocumentRange::invalid()); pathLocation.document = KDevelop::IndexedString(m_url.toLocalFile()); setPlaceholderText(message, pathLocation, i18n("Clang-Tidy")); } -#endif // The code is adapted version of cppcheck::ProblemModel::problemExists() // TODO Add into KDevelop::ProblemModel class ? bool ProblemModel::problemExists(KDevelop::IProblem::Ptr newProblem) { for (const auto& problem : qAsConst(m_problems)) { if (newProblem->source() == problem->source() && newProblem->sourceString() == problem->sourceString() && newProblem->severity() == problem->severity() && newProblem->finalLocation() == problem->finalLocation() && newProblem->description() == problem->description() && newProblem->explanation() == problem->explanation()) return true; } return false; } // The code is adapted version of cppcheck::ProblemModel::addProblems() // TODO Add into KDevelop::ProblemModel class ? void ProblemModel::addProblems(const QVector& problems) { if (m_problems.isEmpty()) { m_maxProblemDescriptionLength = 0; } for (const auto& problem : problems) { if (problemExists(problem)) { continue; } m_problems.append(problem); addProblem(problem); // This performs adjusting of columns width in the ProblemsView if (m_maxProblemDescriptionLength < problem->description().length()) { m_maxProblemDescriptionLength = problem->description().length(); setProblems(m_problems); } } } void ProblemModel::finishAddProblems() { if (m_problems.isEmpty()) { -#if HAVE_PROBLEMMODEL_SETPLACEHOLDERTEXT setMessage(i18n("Analysis completed, no problems detected.")); -#endif } else { setProblems(m_problems); } } } diff --git a/plugins/clangtidy/src/problemmodel.h b/plugins/clangtidy/problemmodel.h similarity index 95% rename from plugins/clangtidy/src/problemmodel.h rename to plugins/clangtidy/problemmodel.h index 98c3ef2c7d..ba15aed15a 100644 --- a/plugins/clangtidy/src/problemmodel.h +++ b/plugins/clangtidy/problemmodel.h @@ -1,74 +1,70 @@ /* * This file is part of KDevelop * * Copyright 2018 Friedrich W. H. Kossebau * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #ifndef CLANGTIDY_PROBLEMMODEL_H #define CLANGTIDY_PROBLEMMODEL_H -// plugin -#include // KDevPlatfrom #include // Qt #include namespace KDevelop { class IProject; } namespace ClangTidy { class Plugin; class ProblemModel : public KDevelop::ProblemModel { Q_OBJECT public: explicit ProblemModel(Plugin* plugin, QObject* parent); ~ProblemModel() override; public: // KDevelop::ProblemModel API void forceFullUpdate() override; public: void addProblems(const QVector& problems); void finishAddProblems(); void reset(KDevelop::IProject* project, const QUrl& url, bool allFiles); private: -#if HAVE_PROBLEMMODEL_SETPLACEHOLDERTEXT void setMessage(const QString& message); -#endif bool problemExists(KDevelop::IProblem::Ptr newProblem); private: Plugin* const m_plugin; QUrl m_url; bool m_allFiles = false; QVector m_problems; int m_maxProblemDescriptionLength = 0; }; } #endif diff --git a/plugins/clangtidy/src/CMakeLists.txt b/plugins/clangtidy/src/CMakeLists.txt deleted file mode 100644 index 9a2e354eb4..0000000000 --- a/plugins/clangtidy/src/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kdevclangtidy\") - -if (NOT KDevPlatform_VERSION VERSION_LESS 5.2.80) - set(HAVE_PROBLEMMODEL_SETPLACEHOLDERTEXT TRUE) -endif() - -configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) - -include_directories( - ${Boost_INCLUDE_DIRS} -) - -set(kdevclangtidy_PART_SRCS - ${kdevclangtidy_LOG_SRCS} - - job.cpp - plugin.cpp - checkset.cpp - problemmodel.cpp - utils.cpp - - config/clangtidyprojectconfigpage.cpp - config/clangtidypreferences.cpp - config/checkselection.cpp - config/checklistfilterproxysearchline.cpp - config/checklistitemproxystyle.cpp - config/checklistmodel.cpp - config/checkgroup.cpp - - parsers/clangtidyparser.cpp -# disable for now: -# CentOS used for appimage does not have string_ref.hpp (Boost >= 1.53) as used by current code -# parsers/replacementparser.cpp -) - -ki18n_wrap_ui(kdevclangtidy_PART_SRCS - config/clangtidypreferences.ui - config/clangtidyprojectconfigpage.ui -) - -qt5_add_resources(kdevclangtidy_PART_SRCS - kdevclangtidy.qrc -) - -kconfig_add_kcfg_files(kdevclangtidy_PART_SRCS - config/clangtidyconfig.kcfgc - config/clangtidyprojectconfig.kcfgc -) - -kdevplatform_add_plugin(kdevclangtidy - JSON kdevclangtidy.json - SOURCES ${kdevclangtidy_PART_SRCS} -) - -target_link_libraries(kdevclangtidy - KDev::Interfaces - KDev::Project - KDev::Language - KDev::OutputView - KDev::Util - KDev::Shell - KF5::ItemViews - KF5::ConfigCore - KF5::I18n -) -if(Qt5_VERSION VERSION_LESS "5.10.0") -target_link_libraries(kdevclangtidy - KF5::ItemModels -) -endif() - -install(FILES org.kde.kdev-clang-tidy.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) diff --git a/plugins/clangtidy/src/Messages.sh b/plugins/clangtidy/src/Messages.sh deleted file mode 100644 index e6d1918c3b..0000000000 --- a/plugins/clangtidy/src/Messages.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash -$EXTRACTRC `find . -name \*.rc` `find . -name \*.ui` >> rc.cpp -$XGETTEXT `find . -name \*.cpp -o -name \*.h` -o $podir/kdevclangtidy.pot -rm -f rc.cpp diff --git a/plugins/clangtidy/src/config.h.in b/plugins/clangtidy/src/config.h.in deleted file mode 100644 index f437b18bca..0000000000 --- a/plugins/clangtidy/src/config.h.in +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef KDEVCLANGTIDY_CONFIG_H -#define KDEVCLANGTIDY_CONFIG_H - -/* config.h. Generated by cmake from config.h.in */ - -#cmakedefine01 HAVE_PROBLEMMODEL_SETPLACEHOLDERTEXT - -#endif // KDEVCLANGTIDY_CONFIG_H diff --git a/plugins/clangtidy/src/org.kde.kdev-clang-tidy.metainfo.xml b/plugins/clangtidy/src/org.kde.kdev-clang-tidy.metainfo.xml deleted file mode 100644 index a2a061a155..0000000000 --- a/plugins/clangtidy/src/org.kde.kdev-clang-tidy.metainfo.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - org.kde.kdev-clang-tidy - org.kde.kdevelop.desktop - KDevelop Clang-Tidy Support - Implementació del Clang-Tidy al KDevelop - Implementació del Clang-Tidy al KDevelop - Podpora Clang-Tidy v KDevelop - Implementación de Clang-Tidy de KDevelop - KDevelopin Clang-Tidy-tuki - Ondersteuning van KDevelop Clang-Tidy - Suporte do Clang-Tidy para o KDevelop - KDevelop Clang-Tidy podpora - KDevelop stöd för Clang-Tidy - Підтримка Clang-Tidy у KDevelop - xxKDevelop Clang-Tidy Supportxx - Clang-Tidy integration with KDevelop - Integració del Clang-Tidy amb el KDevelop - Integració del Clang-Tidy amb el KDevelop - Integrace Clang-Tidy v KDevelop - Integración de Clang-Tidy en KDevelop - KDevelopin Clang-Tidy-integrointi - Integratie van Clang-Tidy met KDevelop - Integração do Clang-Tidy com o KDevelop - Clang-Tidy integrácia s KDevelop - Integrering av Clang-Tidy med KDevelop - Інтеграція Clang-Tidy із KDevelop - xxClang-Tidy integration with KDevelopxx - GPL-2.0+ - CC0-1.0 - https://kdevelop.org - https://bugs.kde.org/enter_bug.cgi?format=guided&product=kdevelop&component=Analyzer:%20Clang-Tidy - https://docs.kde.org/index.php?application=kdevelop - https://www.kde.org/community/donations/?app=kdevelop - KDE - kossebau@kde.org - diff --git a/plugins/clangtidy/src/qtcompat_p.h b/plugins/clangtidy/src/qtcompat_p.h deleted file mode 100644 index 881b1146a3..0000000000 --- a/plugins/clangtidy/src/qtcompat_p.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of KDevelop - * - * Copyright 2018 Friedrich W. H. Kossebau - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -#ifndef CLANGTIDY_QTCOMPAT_P_H -#define CLANGTIDY_QTCOMPAT_P_H - -#include - -#if QT_VERSION < QT_VERSION_CHECK(5,7,0) -namespace QtPrivate -{ -template struct QAddConst { - typedef const T Type; -}; -} - -// this adds const to non-const objects (like std::as_const) -template -Q_DECL_CONSTEXPR typename QtPrivate::QAddConst::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } -// prevent rvalue arguments: -template -void qAsConst(const T &&) Q_DECL_EQ_DELETE; -#endif - -#endif diff --git a/plugins/clangtidy/tests/CMakeLists.txt b/plugins/clangtidy/tests/CMakeLists.txt index 6a68172724..fbf4ae868d 100644 --- a/plugins/clangtidy/tests/CMakeLists.txt +++ b/plugins/clangtidy/tests/CMakeLists.txt @@ -1,52 +1,53 @@ remove_definitions( -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_BYTEARRAY ) include_directories( ${Boost_INCLUDE_DIRS} - ../src + ../ + "${CMAKE_CURRENT_BINARY_DIR}/.." ) -file(COPY "${PROJECT_SOURCE_DIR}/tests/data" +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/data" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/") # disable for now: # CentOS used for appimage does not have string_ref.hpp (Boost >= 1.53) as used by current code if(FALSE) ecm_add_test(test_replacementparser.cpp - ../src/parsers/replacementparser.cpp + ../parsers/replacementparser.cpp ${kdevclangtidy_LOG_SRCS} TEST_NAME test_replacementparser LINK_LIBRARIES Qt5::Test KDev::Tests ) endif() ecm_add_test(test_clangtidyparser.cpp - ../src/parsers/clangtidyparser.cpp + ../parsers/clangtidyparser.cpp ${kdevclangtidy_LOG_SRCS} TEST_NAME test_clangtidyparser LINK_LIBRARIES Qt5::Test KDev::Tests ) ecm_add_test(test_clangtidyjob.cpp - ../src/job.cpp - ../src/parsers/clangtidyparser.cpp + ../job.cpp + ../parsers/clangtidyparser.cpp ${kdevclangtidy_LOG_SRCS} TEST_NAME test_clangtidyjob LINK_LIBRARIES Qt5::Test KDev::Tests ) ecm_add_test(test_checkgroup.cpp - ../src/config/checkgroup.cpp + ../config/checkgroup.cpp ${kdevclangtidy_LOG_SRCS} TEST_NAME test_checkgroup LINK_LIBRARIES Qt5::Test KDev::Tests ) # TODO: Discover how to test the plugin class. # ecm_add_test(test_plugin.cpp ${PROJECT_SOURCE_DIR}/src/plugin.cpp ${PROJECT_SOURCE_DIR}/src/job.cpp # ${kdevclangtidy_LOG_SRCS} # TEST_NAME test_clangtidyplugin # LINK_LIBRARIES Qt5::Test KDev::Tests) diff --git a/plugins/clangtidy/src/utils.cpp b/plugins/clangtidy/utils.cpp similarity index 100% rename from plugins/clangtidy/src/utils.cpp rename to plugins/clangtidy/utils.cpp diff --git a/plugins/clangtidy/src/utils.h b/plugins/clangtidy/utils.h similarity index 100% rename from plugins/clangtidy/src/utils.h rename to plugins/clangtidy/utils.h