()
| 166 | } |
| 167 | } |
| 168 | |
| 169 | return tools; |
| 170 | } catch (error) { |
| 171 | logError(`Failed to load README: ${error.message}`); |
| 172 | process.exit(1); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | // Validate tools |
| 177 | function validateTools() { |
| 178 | logInfo("🔍 Validating tools list...\n"); |
| 179 | |
| 180 | const configTools = loadToolsConfig(); |
| 181 | const readmeTools = loadReadmeTools(); |
| 182 | |
| 183 | // Flatten config tools for easier comparison |
| 184 | const configToolsFlat = []; |
| 185 | configTools.forEach((category) => { |
| 186 | category.items.forEach((tool) => { |
| 187 | configToolsFlat.push({ |
| 188 | name: tool.name, |
| 189 | category: category.category, |
| 190 | available: tool.available, |
| 191 | }); |
| 192 | }); |
| 193 | }); |
| 194 | |
| 195 | let errors = 0; |
| 196 | let warnings = 0; |
| 197 | |
| 198 | // Check for tools in README that are not in config |
| 199 | logInfo("Checking for tools in README that are not in config..."); |
| 200 | const readmeToolNames = readmeTools.map((t) => t.name); |
| 201 | const configToolNames = configToolsFlat.map((t) => t.name); |
| 202 | |
| 203 | const extraInReadme = readmeToolNames.filter( |
| 204 | (name) => !configToolNames.includes(name) |
| 205 | ); |
| 206 | if (extraInReadme.length > 0) { |
| 207 | logError(`Tools in README but not in config: ${extraInReadme.join(", ")}`); |
| 208 | errors++; |
| 209 | } |
| 210 | |
| 211 | // Check for tools in config that are not in README |
| 212 | logInfo("Checking for tools in config that are not in README..."); |
| 213 | const missingInReadme = configToolNames.filter( |
| 214 | (name) => !readmeToolNames.includes(name) |
| 215 | ); |
| 216 | if (missingInReadme.length > 0) { |
| 217 | logError( |
| 218 | `Tools in config but not in README: ${missingInReadme.join(", ")}` |
| 219 | ); |
| 220 | errors++; |
| 221 | } |
| 222 | |
| 223 | // Check for category mismatches |
| 224 | logInfo("Checking for category mismatches..."); |
| 225 | const categoryMismatches = []; |
no test coverage detected