Changeset View
Changeset View
Standalone View
Standalone View
addons/project/kateprojectcodeanalysistool.h
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 43 | public: | |||
---|---|---|---|---|---|
52 | /** | 52 | /** | ||
53 | * @return tool descriptive name | 53 | * @return tool descriptive name | ||
54 | */ | 54 | */ | ||
55 | virtual QString name() = 0; | 55 | virtual QString name() = 0; | ||
56 | 56 | | |||
57 | /** | 57 | /** | ||
58 | * @returns a string containing the file extensions this | 58 | * @returns a string containing the file extensions this | ||
59 | * tool should be run, separated by '|', | 59 | * tool should be run, separated by '|', | ||
60 | * e.g. "cpp|cxx" | 60 | * e.g. "cpp|cxx" | ||
dhaumann: make the function const (can be done in a separate patch that also makes name() etc const. | |||||
61 | * NOTE that this is used directly as part of a regular expression. | 61 | * NOTE that this is used directly as part of a regular expression. | ||
62 | * If more flexibility is required this method probably will change | 62 | * If more flexibility is required this method probably will change | ||
63 | */ | 63 | */ | ||
64 | virtual QString fileExtensions() = 0; | 64 | virtual QString fileExtensions() = 0; | ||
65 | 65 | | |||
66 | /** | 66 | /** | ||
67 | * filter relevant files | 67 | * filter relevant files | ||
68 | * @param files set of files in project | 68 | * @param files set of files in project | ||
Show All 19 Lines | |||||
88 | /** | 88 | /** | ||
89 | * parse output line | 89 | * parse output line | ||
90 | * @param line | 90 | * @param line | ||
91 | * @return file, line, severity, message | 91 | * @return file, line, severity, message | ||
92 | */ | 92 | */ | ||
93 | virtual QStringList parseLine(const QString &line) = 0; | 93 | virtual QStringList parseLine(const QString &line) = 0; | ||
94 | 94 | | |||
95 | /** | 95 | /** | ||
96 | * Tells the tool runner if the returned process exit code | ||||
97 | * was a successful one. | ||||
98 | * | ||||
99 | * The default implementation returns true on exitCode 0. | ||||
100 | * | ||||
101 | * Override this method for a tool that use a non-zero exit code | ||||
102 | * e.g. if the processing itself was successful but not all files | ||||
103 | * had no linter errors. | ||||
104 | */ | ||||
105 | virtual bool isSuccessfulExitCode(int exitCode); | ||||
106 | | ||||
107 | /** | ||||
This looks overly complicated and limited for an interface to me. Why not something like bool isSuccessfulRC(int rc) const? Default impl: return rc == 0; kfunk: This looks overly complicated and limited for an interface to me.
Why not something like `bool… | |||||
Bought! Your suggestion is easier to understand while being more flexible. gregormi: Bought! Your suggestion is easier to understand while being more flexible. | |||||
96 | * @return messages passed to the tool through stdin | 108 | * @return messages passed to the tool through stdin | ||
97 | */ | 109 | */ | ||
98 | virtual QString stdinMessages() = 0; | 110 | virtual QString stdinMessages() = 0; | ||
111 | | ||||
112 | /** | ||||
113 | * @returns the number of files to be processed after the filter | ||||
114 | * has been applied | ||||
115 | */ | ||||
116 | int getActualFilesCount(); | ||||
117 | | ||||
118 | /** | ||||
119 | * To be called by derived classes | ||||
120 | */ | ||||
121 | void setActualFilesCount(int count); | ||||
122 | | ||||
123 | private: | ||||
124 | int m_filesCount = 0; | ||||
99 | }; | 125 | }; | ||
100 | 126 | | |||
101 | Q_DECLARE_METATYPE(KateProjectCodeAnalysisTool*) | 127 | Q_DECLARE_METATYPE(KateProjectCodeAnalysisTool*) | ||
102 | 128 | | |||
103 | #endif // KATE_PROJECT_CODE_ANALYSIS_TOOL_H | 129 | #endif // KATE_PROJECT_CODE_ANALYSIS_TOOL_H |
make the function const (can be done in a separate patch that also makes name() etc const.