[kdevelop] [Bug 409222] kdev_format_source returns "error: no commands applicable to" for any pattern

2020-05-02 Thread Igor Kushnir
https://bugs.kde.org/show_bug.cgi?id=409222

Igor Kushnir  changed:

   What|Removed |Added

   Version Fixed In||5.5.1
  Latest Commit||https://invent.kde.org/kde/
   ||kdevelop/commit/f56cdda54b7
   ||f88b119f2c7cfb2f534b4fe7447
   ||8f
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #4 from Igor Kushnir  ---
Git commit f56cdda54b7f88b119f2c7cfb2f534b4fe74478f by Igor Kushnir.
Committed on 02/05/2020 at 16:28.
Pushed by igorkushnir into branch '5.5'.

Work around QDir::match() behavior change in Qt 5.12.0

QDir::match() migrated to QRegularExpression in Qt 5.12.0. In the new
implementation asterisk in a wildcard no longer matches path separators.

This caused two bugs in KDevelop:
1. kdev_format_source rejects input files if the 'format_sources' file
  is not located in the same directory as the target file.
2. Exclude filter in Find/Replace in Files has no effect (unless the
  user specifies almost complete paths in the format supported by Bash
  Filename Expansion with the globstar shell option disabled).

Note that Files (aka `include`) filter in Find/Replace in Files is
unaffected by the behavior change because in its code a filename rather
than a path is passed as the second argument to QDir::match().

WildcardHelpers can migrate to
QRegularExpression::wildcardToRegularExpression() once we require
Qt 5.12.1 or later. This function was added in Qt 5.12.0 and started
anchoring wildcard pattern in Qt 5.12.1.

Ideally support for globstar (**) in glob patterns should be added to
QRegularExpression::wildcardToRegularExpression() and to QDir::match().
In that case WildcardHelpers could be eliminated and QDir::match() could
be used again.

If globstar support is not added to
QRegularExpression::wildcardToRegularExpression(), WildcardHelpers can
port away from QRegExp, for example, by replacing `starEscape` (see the
definition of wildcardToRegularExpression()) with ".*" in the value
returned by wildcardToRegularExpression() and passing
DotMatchesEverythingOption to QRegularExpression constructor.

When we port away from QRegExp, we can change the syntax of
format_sources and possibly Exclude filter to match Bash globstar
syntax or perhaps some other new Qt wildcard syntax. Alternatively, we
can process user-provided wildcard patterns before and/or after passing
them to wildcardToRegularExpression() so as to preserve our syntax.
Related: bug 417628
FIXED-IN: 5.5.1

M  +1-0kdevplatform/util/CMakeLists.txt
M  +3-1kdevplatform/util/kdevformatfile.cpp
A  +59   -0kdevplatform/util/wildcardhelpers.h [License: LGPL (v2+)]
M  +2-1plugins/grepview/grepdialog.cpp
M  +4-2plugins/grepview/grepfindthread.cpp

https://invent.kde.org/kde/kdevelop/commit/f56cdda54b7f88b119f2c7cfb2f534b4fe74478f

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdevelop] [Bug 409222] kdev_format_source returns "error: no commands applicable to" for any pattern

2020-03-24 Thread Igor Kushnir
https://bugs.kde.org/show_bug.cgi?id=409222

Igor Kushnir  changed:

   What|Removed |Added

 CC||igor...@meta.ua
   Assignee|kdevelop-bugs-n...@kde.org  |igor...@meta.ua
 Ever confirmed|0   |1
 Status|REPORTED|ASSIGNED

--- Comment #3 from Igor Kushnir  ---
This is one of the consequences of QDir::match() behavior change since Qt 5.12:
https://bugreports.qt.io/browse/QTBUG-73797. I'm working on a fix.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdevelop] [Bug 409222] kdev_format_source returns "error: no commands applicable to" for any pattern

2019-06-27 Thread Eugene Shalygin
https://bugs.kde.org/show_bug.cgi?id=409222

--- Comment #2 from Eugene Shalygin  ---
(In reply to Kevin Funk from comment #1)
> Would you like to submit a proper patch to

Replacing QDir::match() with fnmatch() is not a big deal of a change, but there
are Q_OS_WIN defines in that file and I can't test on Windows. Another problem
is that the code change requires changes to wildcards in format_sources. For
example, '*' has to be replaced with '**/*'. I can't decide how to proceed with
that.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdevelop] [Bug 409222] kdev_format_source returns "error: no commands applicable to" for any pattern

2019-06-27 Thread Kevin Funk
https://bugs.kde.org/show_bug.cgi?id=409222

--- Comment #1 from Kevin Funk  ---
Would you like to submit a proper patch to https://invent.kde.org/kde/kdevelop?

Gives you the ability to have proper patch authoring information and
attribution inside your commit :)

-- 
You are receiving this mail because:
You are watching all bug changes.