Changeset View
Changeset View
Standalone View
Standalone View
pythonstylechecking.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 101 | if ( (match = errorFormat.match(error)).hasMatch() ) { | |||
---|---|---|---|---|---|
104 | int lineno = match.captured(2).toInt(&lineno_ok); | 104 | int lineno = match.captured(2).toInt(&lineno_ok); | ||
105 | int colno = match.captured(3).toInt(&colno_ok); | 105 | int colno = match.captured(3).toInt(&colno_ok); | ||
106 | if ( ! lineno_ok || ! colno_ok ) { | 106 | if ( ! lineno_ok || ! colno_ok ) { | ||
107 | qCDebug(KDEV_PYTHON) << "invalid line / col number"; | 107 | qCDebug(KDEV_PYTHON) << "invalid line / col number"; | ||
108 | continue; | 108 | continue; | ||
109 | } | 109 | } | ||
110 | QString error = match.captured(4); | 110 | QString error = match.captured(4); | ||
111 | KDevelop::Problem* p = new KDevelop::Problem(); | 111 | KDevelop::Problem* p = new KDevelop::Problem(); | ||
112 | p->setFinalLocation(DocumentRange(document, KTextEditor::Range(lineno - 1, qMax(colno - 4, 0), | 112 | p->setFinalLocation(DocumentRange(document, KTextEditor::Range(lineno - 1, qMax(colno - 1, 0), | ||
113 | lineno - 1, colno + 4))); | 113 | lineno - 1, colno))); | ||
114 | p->setSource(KDevelop::IProblem::Preprocessor); | 114 | p->setSource(KDevelop::IProblem::Preprocessor); | ||
115 | p->setSeverity(error.startsWith('W') ? KDevelop::IProblem::Hint : KDevelop::IProblem::Warning); | 115 | p->setSeverity(error.startsWith('W') ? KDevelop::IProblem::Hint : KDevelop::IProblem::Warning); | ||
116 | p->setDescription(i18n("PEP8 checker error: %1", error)); | 116 | p->setDescription(i18n("PEP8 checker error: %1", error)); | ||
117 | ProblemPointer ptr(p); | 117 | ProblemPointer ptr(p); | ||
118 | m_currentlyChecking->addProblem(ptr); | 118 | m_currentlyChecking->addProblem(ptr); | ||
119 | } | 119 | } | ||
120 | else { | 120 | else { | ||
121 | qCDebug(KDEV_PYTHON) << "invalid pep8 error line:" << error; | 121 | qCDebug(KDEV_PYTHON) << "invalid pep8 error line:" << error; | ||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |