Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions cli/src/commands/wheels/analyze/code.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ component extends="../base" {
// Display issues by file
if (structCount(results.files) > 0) {
detailOutput.subHeader("Issues by File");
var filteredSeverity = lcase(arguments.severity);
for (var filePath in results.files) {
var fileIssues = results.files[filePath];
var relativePath = replace(filePath, getCWD(), "");
Expand All @@ -189,15 +190,13 @@ component extends="../base" {
// Group issues by severity for better readability
var groupedIssues = groupIssuesBySeverity(fileIssues);

for (var severity in ["error", "warning", "info"]) {
if (structKeyExists(groupedIssues, severity) && arrayLen(groupedIssues[severity]) > 0) {
for (var issue in groupedIssues[severity]) {
var icon = getSeverityIcon(issue.severity);
var color = getSeverityColor(issue.severity);
if (structKeyExists(groupedIssues, filteredSeverity) && arrayLen(groupedIssues[filteredSeverity]) > 0) {
for (var issue in groupedIssues[filteredSeverity]) {
var icon = getSeverityIcon(issue.severity);
var color = getSeverityColor(issue.severity);

detailOutput.output("#icon# Line #issue.line#:#issue.column# - #issue.message#", true);
print.cyanLine(" Rule: #issue.rule#" & (issue.fixable ? " [Auto-fixable]" : "")).toConsole();
}
detailOutput.output("#icon# Line #issue.line#:#issue.column# - #issue.message#", true);
print.cyanLine(" Rule: #issue.rule#" & (issue.fixable ? " [Auto-fixable]" : "")).toConsole();
}
}

Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/wheels/config/dump.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ component extends="commandbox.modules.wheels-cli.commands.wheels.base" {
// Output to console if not table format
if(arguments.format == "json"){
detailOutput.line();
detailOutput.output(deserializeJSON(local.outputContent));
detailOutput.getPrint().line(deserializeJSON(local.outputContent)).toConsole();
} else {
detailOutput.line();
detailOutput.output(local.outputContent);
Expand Down
34 changes: 17 additions & 17 deletions cli/src/commands/wheels/generate/code.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ component aliases="wheels g code" extends="../base" {
* @force.hint Overwrite existing files
*/
function run(
required string pattern,
string pattern,
boolean list = false,
string category = "",
string output = "console",
Expand Down Expand Up @@ -53,16 +53,16 @@ component aliases="wheels g code" extends="../base" {

if (!len(arguments.pattern)) {
detailOutput.error("Pattern name is required");
detailOutput.getPrint().line("Usage: wheels g code <pattern-name>");
detailOutput.getPrint().line("Run 'wheels g code --list' to see available patterns");
detailOutput.output("Usage: wheels g code <pattern-name>", true);
detailOutput.output("Run 'wheels g code --list' to see available patterns", true);
setExitCode(1);
return;
}

var snippet = getSnippetByName(arguments.pattern);
if (!structCount(snippet)) {
detailOutput.error("Code snippet '#arguments.pattern#' not found");
detailOutput.getPrint().line("Run 'wheels g code --list' to see available patterns");
detailOutput.output("Run 'wheels g code --list' to see available patterns", true);
setExitCode(1);
return;
}
Expand Down Expand Up @@ -102,16 +102,16 @@ component aliases="wheels g code" extends="../base" {
for (var cat in categoryOrder) {
var key = lCase(cat);
if (structKeyExists(categories, key)) {
detailOutput.getPrint().line("");
detailOutput.getPrint().boldLine("#cat#:");
detailOutput.line();
detailOutput.getPrint().boldLine("#cat#:").toConsole();
for (var snippet in categories[key]) {
detailOutput.getPrint().line(" - #snippet.name# - #snippet.description#");
detailOutput.output(" - #snippet.name# - #snippet.description#", true);
}
}
}

detailOutput.getPrint().line("");
detailOutput.getPrint().line("");
detailOutput.line();
detailOutput.line();
detailOutput.nextSteps([
"Generate a code snippet: wheels g code <pattern-name>"
]);
Expand All @@ -122,11 +122,11 @@ component aliases="wheels g code" extends="../base" {
*/
private function printSnippet(required struct snippet) {
detailOutput.header("Generating Code Snippet: #arguments.snippet.name#");
detailOutput.getPrint().line("");
detailOutput.line();

var content = getSnippetContent(arguments.snippet);
detailOutput.getPrint().line(content);
detailOutput.getPrint().line("");
detailOutput.output("#content#");
detailOutput.line();

detailOutput.success("Code snippet '#arguments.snippet.name#' generated successfully!");
}
Expand All @@ -140,7 +140,7 @@ component aliases="wheels g code" extends="../base" {

if (fileExists(resolvedPath) && !arguments.force) {
detailOutput.error("File already exists: #resolvedPath#");
detailOutput.getPrint().line("Use --force to overwrite");
detailOutput.output("Use --force to overwrite", true);
setExitCode(1);
return;
}
Expand Down Expand Up @@ -429,9 +429,9 @@ component aliases="wheels g code" extends="../base" {
*/
private function showCustomizationOptions() {
detailOutput.header("Customization Options");
detailOutput.getPrint().line("You can customize code snippets by:");
detailOutput.getPrint().line(" 1. Creating custom code snippets with --create");
detailOutput.getPrint().line(" 2. Saving code snippets to files with --output=file");
detailOutput.getPrint().line(" 3. Filtering by category with --category");
detailOutput.output("You can customize code snippets by:");
detailOutput.output(" 1. Creating custom code snippets with --create");
detailOutput.output(" 2. Saving code snippets to files with --output=file");
detailOutput.output(" 3. Filtering by category with --category");
}
}
4 changes: 2 additions & 2 deletions cli/src/commands/wheels/generate/scaffold.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ component aliases="wheels g scaffold, wheels g resource, wheels generate resourc
// Run migrations if requested
if (arguments.migrate) {
detailOutput.invoke("dbmigrate");
command('wheels dbmigrate up').run();
command('wheels dbmigrate latest').run();
} else if (!arguments.api) {
// Only ask to migrate in interactive mode
try {
if (confirm("Would you like to run migrations now? [y/n]")) {
detailOutput.invoke("dbmigrate");
command('wheels dbmigrate up').run();
command('wheels dbmigrate latest').run();
}
} catch (any e) {
// Skip if non-interactive
Expand Down
48 changes: 22 additions & 26 deletions cli/src/commands/wheels/get/settings.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -207,39 +207,35 @@ component extends="../base" {

private void function parseSettings(required string content, required struct settings) {
// Parse set() calls in the settings file
local.pattern = 'set\s*\(\s*([^=]+)\s*=\s*([^)]+)\)';
local.pattern = 'set\s*\(\s*([^=\s]+(?:\s*[^=\s]*)*)\s*=\s*([^)]+)\)';
local.matches = REMatchNoCase(local.pattern, arguments.content);

for (local.match in local.matches) {
try {
// Extract key and value
local.parts = REFind(local.pattern, local.match, 1, true);
local.extractPattern = 'set\s*\(\s*([^=]+?)\s*=\s*([^)]+)\)';
local.parts = REFindNoCase(local.extractPattern, local.match, 1, true);

if (local.parts.pos[1] > 0) {
local.assignment = Mid(local.match, local.parts.pos[2], local.parts.len[2]);
local.assignParts = ListToArray(local.assignment, "=");
if (ArrayLen(local.assignParts) >= 2) {
local.key = Trim(local.assignParts[1]);
// Join remaining parts with = in case value contains =
local.valueParts = [];
for (local.i = 2; local.i <= ArrayLen(local.assignParts); local.i++) {
ArrayAppend(local.valueParts, local.assignParts[local.i]);
}
local.value = Trim(ArrayToList(local.valueParts, "="));

// Clean up the value
local.value = REReplace(local.value, "^['""]|['""]$", "", "all");

// Try to parse boolean/numeric values
if (local.value == "true") {
local.value = true;
} else if (local.value == "false") {
local.value = false;
} else if (IsNumeric(local.value)) {
local.value = Val(local.value);
}

arguments.settings[local.key] = local.value;
// Extract key (trim whitespace)
local.key = Trim(Mid(local.match, local.parts.pos[2], local.parts.len[2]));

// Extract value (trim whitespace)
local.value = Trim(Mid(local.match, local.parts.pos[3], local.parts.len[3]));

// Clean up quotes from the value
local.value = REReplace(local.value, "^['""]|['""]$", "", "all");

// Try to parse boolean/numeric values
if (local.value == "true") {
local.value = true;
} else if (local.value == "false") {
local.value = false;
} else if (IsNumeric(local.value)) {
local.value = Val(local.value);
}

arguments.settings[local.key] = local.value;
}
} catch (any e) {
// Skip malformed settings
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/wheels/plugins/list.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ component aliases="wheels plugin list" extends="../base" {
}

// Display the table
detailOutput.getPrint().table(rows);
detailOutput.getPrint().table(rows).toConsole();

detailOutput.line();
detailOutput.divider("-", 60);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/wheels/plugins/outdated.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ component aliases="wheels plugin outdated,wheels plugins outdated" extends="../b
}

// Display the table
print.table(rows);
print.table(rows).toConsole();

detailOutput.line();
detailOutput.divider("-", 60);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/wheels/plugins/search.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ component aliases="wheels plugin search" extends="../base" {


// Display the table
detailOutput.getPrint().table(rows);
detailOutput.getPrint().table(rows).toConsole();

detailOutput.line();
detailOutput.divider();
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/wheels/plugins/update.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ component aliases="wheels plugin update" extends="../base" {
// Show version comparison
detailOutput.subHeader("Update Summary");
detailOutput.metric("Plugin", pluginInfo.name);
detailOutput.update("Version", "v#currentVersion# → v#targetVersion#");
detailOutput.metric("Version", "v#currentVersion# → v#targetVersion#");
detailOutput.metric("Location", "/plugins/#foundPlugin.folderName#");
detailOutput.line();

Expand Down
7 changes: 3 additions & 4 deletions cli/src/commands/wheels/plugins/updateAll.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* wheels plugin update:all
* wheels plugin update:all --dryRun
*/
component aliases="wheels plugin update:all,wheels plugins update:all" extends="../base" {
component aliases="wheels plugin update:all,wheels plugins update:all, wheels plugin updateall" extends="../base" {

property name="pluginService" inject="PluginService@wheels-cli";
property name="packageService" inject="PackageService";
Expand Down Expand Up @@ -122,7 +122,7 @@ component aliases="wheels plugin update:all,wheels plugins update:all" extends="
});
}

print.table(updateRows);
print.table(updateRows).toConsole();
detailOutput.line();

if (arguments.dryRun) {
Expand Down Expand Up @@ -198,7 +198,6 @@ component aliases="wheels plugin update:all,wheels plugins update:all" extends="

// Show final summary
detailOutput.line();
detailOutput.divider("=", 60);
detailOutput.header("Update Summary");
detailOutput.line();

Expand All @@ -214,7 +213,7 @@ component aliases="wheels plugin update:all,wheels plugins update:all" extends="
arrayAppend(summaryRows, { "Status" = "Check errors", "Count" = "#arrayLen(errors)#" });
}

print.table(summaryRows);
print.table(summaryRows).toConsole();
detailOutput.line();

if (successCount > 0) {
Expand Down
3 changes: 0 additions & 3 deletions docs/src/command-line-tools/commands/test/test-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,4 @@ box server restart

## See Also

- [wheels test](test.md) - Run framework tests
- [wheels test coverage](test-coverage.md) - Generate coverage
- [wheels test debug](test-debug.md) - Debug tests
- [wheels generate test](../generate/test.md) - Generate test files
Loading