-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
214 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class CodacyCliV2 < Formula | ||
version "0.1.0-main.35.70f0f48" | ||
url "https://raw.githubusercontent.com/codacy/codacy-cli-v2/0.1.0-main.35.70f0f48/codacy-cli.sh" | ||
sha256 "fb616e2f5c639985566c81a6e6ce51db2e8de56bf217e837d13efe2f3ccc3042" | ||
|
||
def install | ||
bin.install "codacy-cli.sh" => "codacy-cli" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package config | ||
package config_file | ||
|
||
import ( | ||
"errors" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package config | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os/exec" | ||
"path" | ||
) | ||
|
||
func genInfoEslint(r *Runtime) map[string]string { | ||
eslintFolder := fmt.Sprintf("%s@%s", r.Name(), r.Version()) | ||
installDir := path.Join(Config.ToolsDirectory(), eslintFolder) | ||
|
||
return map[string]string{ | ||
"installDir": installDir, | ||
"eslint": path.Join(installDir, "node_modules", ".bin", "eslint"), | ||
} | ||
} | ||
|
||
/* | ||
* This installs eslint using node's npm alongside its sarif extension | ||
*/ | ||
func InstallEslint(nodeRuntime *Runtime, eslint *Runtime) error { | ||
log.Println("Installing ESLint") | ||
|
||
eslintInstallArg := fmt.Sprintf("%s@%s", eslint.Name(), eslint.Version()) | ||
cmd := exec.Command(nodeRuntime.Info()["npm"], "install", "--prefix", eslint.Info()["installDir"], | ||
eslintInstallArg, "@microsoft/eslint-formatter-sarif") | ||
// to use the chdir command we needed to create the folder before, we can change this after | ||
// cmd.Dir = eslintInstallationFolder | ||
stdout, err := cmd.Output() | ||
// Print the output | ||
fmt.Println(string(stdout)) | ||
return err | ||
} |
Oops, something went wrong.