Changeset View
Changeset View
Standalone View
Standalone View
addons/project/kateprojectcodeanalysistool.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 43 | public: | |||
---|---|---|---|---|---|
50 | virtual void setProject(KateProject *project); | 50 | virtual void setProject(KateProject *project); | ||
51 | 51 | | |||
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 | * @return tool short description | ||||
59 | */ | ||||
60 | virtual QString description() = 0; | ||||
dhaumann: make the function const (can be done in a separate patch that also makes name() etc const. | |||||
61 | | ||||
62 | /** | ||||
58 | * @returns a string containing the file extensions this | 63 | * @returns a string containing the file extensions this | ||
59 | * tool should be run, separated by '|', | 64 | * tool should be run, separated by '|', | ||
60 | * e.g. "cpp|cxx" | 65 | * e.g. "cpp|cxx" | ||
61 | * NOTE that this is used directly as part of a regular expression. | 66 | * NOTE that this is used directly as part of a regular expression. | ||
62 | * If more flexibility is required this method probably will change | 67 | * If more flexibility is required this method probably will change | ||
63 | */ | 68 | */ | ||
64 | virtual QString fileExtensions() = 0; | 69 | virtual QString fileExtensions() = 0; | ||
65 | 70 | | |||
Show All 22 Lines | |||||
88 | /** | 93 | /** | ||
89 | * parse output line | 94 | * parse output line | ||
90 | * @param line | 95 | * @param line | ||
91 | * @return file, line, severity, message | 96 | * @return file, line, severity, message | ||
92 | */ | 97 | */ | ||
93 | virtual QStringList parseLine(const QString &line) = 0; | 98 | virtual QStringList parseLine(const QString &line) = 0; | ||
94 | 99 | | |||
95 | /** | 100 | /** | ||
101 | * Tells the tool runner if the returned process exit code | ||||
102 | * was a successful one. | ||||
103 | * | ||||
104 | * The default implementation returns true on exitCode 0. | ||||
105 | * | ||||
106 | * Override this method for a tool that use a non-zero exit code | ||||
107 | * e.g. if the processing itself was successful but not all files | ||||
108 | * had no linter errors. | ||||
109 | */ | ||||
110 | virtual bool isSuccessfulExitCode(int exitCode); | ||||
111 | | ||||
112 | /** | ||||
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 | 113 | * @return messages passed to the tool through stdin | ||
97 | */ | 114 | */ | ||
98 | virtual QString stdinMessages() = 0; | 115 | virtual QString stdinMessages() = 0; | ||
116 | | ||||
117 | /** | ||||
118 | * @returns the number of files to be processed after the filter | ||||
119 | * has been applied | ||||
120 | */ | ||||
121 | int getActualFilesCount(); | ||||
122 | | ||||
123 | /** | ||||
124 | * To be called by derived classes | ||||
125 | */ | ||||
126 | void setActualFilesCount(int count); | ||||
127 | | ||||
128 | private: | ||||
129 | int m_filesCount = 0; | ||||
99 | }; | 130 | }; | ||
100 | 131 | | |||
101 | Q_DECLARE_METATYPE(KateProjectCodeAnalysisTool*) | 132 | Q_DECLARE_METATYPE(KateProjectCodeAnalysisTool*) | ||
102 | 133 | | |||
103 | #endif // KATE_PROJECT_CODE_ANALYSIS_TOOL_H | 134 | #endif // KATE_PROJECT_CODE_ANALYSIS_TOOL_H |
make the function const (can be done in a separate patch that also makes name() etc const.