You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ provider,owner: organization, name }=repository
25
+
repositoryRules.push({
26
26
when: 'using any tool that has either one of the following arguments: provider, organization or repository',
27
27
enforce: [
28
-
`use ${provider} for provider, ${organization} for organization and ${repository} for repository, and avoid calling 'git remote -v' unless really necessary`,
28
+
`use ${provider} for provider, ${organization} for organization and ${name} for repository, and avoid calling 'git remote -v' unless really necessary`,
29
29
],
30
-
},
30
+
})
31
+
}
32
+
33
+
constcommonRules: Rule[]=[
31
34
{
32
35
when: 'after ANY successful edit_file or reapply tool call',
33
36
enforce: [
34
37
'IMMEDIATELY run codacy_cli_analyze tool for each edited file with:',
35
38
'1. rootPath set to the workspace path',
36
39
'2. file set to the edited file path',
40
+
'3. no tool',
41
+
'AT THE END run codacy_cli_analyze tool for Trivy for the entire project with:',
42
+
'1. rootPath set to the workspace path',
43
+
'2. no file',
44
+
'3. tool set to Trivy',
37
45
'If issues are found, propose fixes for them',
38
46
],
39
47
},
40
-
],
41
-
})
48
+
{
49
+
when: 'after adding new dependencies, libraries or packages',
50
+
enforce: [
51
+
'IMMEDIATELY run codacy_cli_analyze tool for Trivy for:',
52
+
'1. rootPath set to the workspace path',
53
+
'2. no file',
54
+
'3. tool set to Trivy',
55
+
'If issues are found, propose fixes for them',
56
+
],
57
+
},
58
+
]
59
+
60
+
return{
61
+
name: 'Codacy Rules',
62
+
description: 'Configuration for AI behavior when interacting with Codacy',
63
+
rules: [...repositoryRules, ...commonRules],
64
+
}
65
+
}
66
+
42
67
// Function to sanitize the JSON content to avoid trailing commas
0 commit comments