@sonar-autofix/core 0.0.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -2
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -23,6 +23,7 @@ class CoreOrchestrator {
|
|
|
23
23
|
constructor(config, deps = {}) {
|
|
24
24
|
this.config = config;
|
|
25
25
|
this.dryRun = config.dryRun || false;
|
|
26
|
+
this.restoreOnFail = config.restoreOnFail || false;
|
|
26
27
|
this.retryLimit = config.retry?.maxRetries || DEFAULT_RETRY_LIMIT;
|
|
27
28
|
this.maxIterations = config.retry?.maxIterations || DEFAULT_MAX_ITERATIONS;
|
|
28
29
|
this.cwd = config.cwd || process.cwd();
|
|
@@ -138,8 +139,9 @@ class CoreOrchestrator {
|
|
|
138
139
|
fixedInIteration++;
|
|
139
140
|
console.log(` ✓ ${filePath} fixed successfully`);
|
|
140
141
|
} else {
|
|
141
|
-
console.log(` ✗ ${filePath} could not be fixed
|
|
142
|
-
if (!this.dryRun) {
|
|
142
|
+
console.log(` ✗ ${filePath} could not be fixed`);
|
|
143
|
+
if (!this.dryRun && this.restoreOnFail) {
|
|
144
|
+
console.log(` ✗ ${filePath} could not be fixed — restoring original`);
|
|
143
145
|
await this.gitClient.restoreFile(filePath);
|
|
144
146
|
}
|
|
145
147
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonar-autofix/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Core orchestrator for the Sonar Autofix tool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"author": "Sonar Autofix Team",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sonar-autofix/sonar-client": "^0.0.
|
|
19
|
-
"@sonar-autofix/llm-client": "^0.0.
|
|
18
|
+
"@sonar-autofix/sonar-client": "^0.0.3",
|
|
19
|
+
"@sonar-autofix/llm-client": "^0.0.2",
|
|
20
20
|
"@sonar-autofix/git-client": "^0.0.1"
|
|
21
21
|
}
|
|
22
22
|
}
|