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
'Analyze your code with a selection of rules to ensure good coding practices. You can scan your codebase with the recommended rules. Or use flags to filter the rules based on engines (such as "retire-js" or "eslint"), rule names, tags, and more. Always execute the `list_code_analyzer_rules` tool first to understnad which rules to provide into ruleSelector parameter based on the files to be scanned.',
92
+
"Analyze code for quality and security issues. Run list_code_analyzer_rulesfirst to select appropriate rules for ruleSelector parameter.",
93
93
{
94
94
input: z.object({
95
95
workspace: z
96
96
.array(z.string())
97
97
.optional()
98
98
.describe(
99
-
"Set of files that make up your workspace. Typically, a workspace is a single project folder that contains all your files. But it can also consist of one or more folders, one or more files, and use glob patterns (wildcards). If you specify this flag multiple times, then your workspace is the sum of the files and folders. Some engines often need your entire code base to perform an analysis, even if you want to target only a subset of the files within your workspace, such as with the --target flag. If you don't specify the --workspace flag, then the current folder '.' is used as your workspace."
99
+
"Files/folders to analyze. Supports glob patterns. Multiple values are summed. Defaults to current folder '.'"
100
100
),
101
101
target: z
102
102
.array(z.string())
103
103
.optional()
104
104
.describe(
105
-
"Subset of files within your workspace to be targeted for analysis.You can specify a target as a file, a folder, or a glob pattern. If you specify this flag multiple times, then the full list of targeted files is the sum of the files and folders. Each targeted file must live within the workspace that you specified with the `–-workspace` flag. If you don't specify the `--target` flag, then all the files within your workspace (specified by the `--workspace` flag) are targeted for analysis."
105
+
"Specific files/folders to target within workspace. Supports glob patterns. Defaults to all workspace files."
106
106
),
107
107
ruleSelector: z
108
108
.array(z.string())
109
109
.describe(
110
-
'Selection of rules, based on engine name, severity level, rule name, tag, or a combination of criteria separated by colons. Use the `--rule-selector` flag to select the list of rules to run based on specific criteria. For example, you can select by engine, such as the rules associated with the "retire-js" or "eslint" engine. Or select by the severity of the rules, such as high or moderate. You can also select rules using tag values or rule names. Every rule has a name, which is unique within the scope of an engine. Most rules have tags, although it\'s not required. An example of a tag is "Recommended". You can combine different criteria using colons to further filter the list; the colon works as an intersection. For example, `--rule-selector eslint:Security` runs rules associated only with the "eslint" engine that have the Security tag. The flag `--rule-selector eslint:Security:3` flag runs the "eslint" rules that have the Security tag and moderate severity (3). To add multiple rule selectors together (a union), specify the `--rule-selector` flag multiple times, such as `--rule-selector eslint:Recommended --rule-selector retire-js:3`. Run `sf code-analyzer rules --rule-selector all` to see the possible values for engine name, rule name, tags, and severity levels that you can use with this flag.'
110
+
'Select rules by engine, severity, name, or tag. Use colons to combine (e.g., "eslint:Security:3"). Multiple selectors create union. Run with "all" to see available values.'
111
111
),
112
112
outputFile: z
113
113
.string()
114
114
.optional()
115
115
.describe(
116
-
"Specify a file to save the output to. This flag can be used with or without the --output-format flag. If you don't specify the output format, the output is formatted based on the file extension of the specified file. Specifying a file extension that doesn't match a supported output format results in a JSON file being created."
116
+
"Save output tofile. Format auto-detected from extension or defaults to JSON."
117
117
),
118
118
severity: z
119
119
.enum(["High","Medium","Low"])
120
120
.optional()
121
121
.describe(
122
-
"Throw a non-zero exit code when rule violations of the specified severity (or more severe) are found. Values are High, Medium, and Low. The default is --severity-threshold=Low"
122
+
"Exit with error on violations at/above this severity. Default: Low"
123
123
),
124
124
configFile: z
125
125
.string()
126
126
.optional()
127
127
.describe(
128
-
"Path to the configuration file used to customize the engines and rules. Code Analyzer has an internal default configuration for its rule and engine properties. If you want to override these defaults, you can create a Code Analyzer configuration file. We recommend that you name your Code Analyzer configuration file `code-analyzer.yml` or `code-analyzer.yaml` and put it at the root of your workspace. You then don't need to use this flag when you run the `code-analyzer run` command from the root of your workspace, because it automatically looks for either file in the current folder, and if found, applies its rule overrides and engine settings. If you want to name the file something else, or put it in an alternative folder, then you must specify this flag. To help you get started, use the `code-analyzer config` command to create your first Code Analyzer configuration file. With it, you can change the severity of an existing rule, change a rule's tags, and so on. Then use this flag to specify the file so that the command takes your customizations into account."
128
+
"Config file to customize rules/engines. Auto-detects code-analyzer.yml/yaml in current folder. Use 'code-analyzer config' to create."
"List the rules that are available to analyze your code. You can also view details about the rules, such as the engine it's associated with, tags, and description. Use this command to determine the exact set of rules to analyze your code. The `code-analyzer run` command has similar flags as this command, so once you've determined the flag values for this command that list the rules you want to run, you specify the same values to the `code-analyzer run` command.",
196
+
"List available code analysis ruleswith details. Use to determine rules for code-analyzer run command.",
197
197
{
198
198
input: z.object({
199
199
workspace: z
200
200
.array(z.string())
201
201
.optional()
202
202
.describe(
203
-
"Set of files that make up your workspace for rule discovery."
203
+
"Files/folders for rule discovery. Supports glob patterns."
204
204
),
205
205
target: z
206
206
.array(z.string())
207
207
.optional()
208
208
.describe(
209
-
"Subset of files within your workspace to be targeted for analysis.You can specify a target as a file, a folder, or a glob pattern. If you specify this flag multiple times, then the full list of targeted files is the sum of the files and folders. Each targeted file must live within the workspace that you specified with the `–-workspace` flag. If you don't specify the `--target` flag, then all the files within your workspace (specified by the `--workspace` flag) are targeted for analysis."
209
+
"Specific files/folders to target within workspace. Supports glob patterns. Defaults to all workspace files."
210
210
),
211
211
configFile: z
212
212
.string()
213
213
.optional()
214
-
.describe(
215
-
"Use the specified configuration file to discover rules."
216
-
),
214
+
.describe("Config file for rule discovery."),
217
215
ruleSelector: z
218
216
.array(z.string())
219
217
.optional()
220
218
.describe(
221
-
"Filter rules by their names, tags, categories, or engines."
219
+
"Filter rules by name, tag, category, or engine."
222
220
),
223
221
view: z
224
222
.enum(["detail","table"])
225
223
.optional()
226
224
.describe(
227
-
"Format to display the rules in the terminal. The format 'table' is concise and shows minimal output, the format 'detail' shows all available information. Default is 'table'."
225
+
"Display format: 'table' (concise) or 'detail' (full info). Default: 'table'."
"Deploy metadata to Salesforce org with test execution options.",
63
63
{
64
64
input: z.object({
65
-
targetOrg: z
66
-
.string()
67
-
.describe(
68
-
"Username or alias of the target org. Not required if the 'target-org' configuration variable is already set."
69
-
),
65
+
targetOrg: z.string().describe("Target org username or alias."),
70
66
dryRun: z
71
67
.boolean()
72
-
.describe(
73
-
"Validate deploy and run Apex tests but don't save to the org."
74
-
),
68
+
.describe("Validate only, don't save changes."),
75
69
manifest: z
76
70
.string()
77
71
.optional()
78
72
.describe(
79
-
"Full file path for manifest (package.xml) of components to deploy. All child components are included. If you specify this flag, don’t specify --metadata or --source-dir."
73
+
"Package.xml manifest path. Excludes --metadata and --source-dir."
80
74
),
81
75
metadata: z
82
76
.string()
83
77
.optional()
84
78
.describe(
85
-
"Metadata component names to deploy. Wildcards (`*` ) supported as long as you use quotes, such as `ApexClass:MyClass*`."
79
+
"Component names to deploy. Supports wildcards with quotes."
86
80
),
87
81
metadataDirectory: z
88
82
.string()
89
83
.optional()
90
-
.describe(
91
-
"Root of directory or zip file of metadata formatted files to deploy."
92
-
),
84
+
.describe("Metadata directory or zip file to deploy."),
93
85
singlePackage: z
94
86
.boolean()
95
87
.optional()
96
88
.describe(
97
-
"Indicates that the metadata zip file points to a directory structure for a single package."
89
+
"Metadata zip contains single package structure."
98
90
),
99
91
sourceDirectory: z
100
92
.string()
101
93
.optional()
102
94
.describe(
103
-
"Path to the local source files to deploy. The supplied path can be to a single file (in which case the operation is applied to only one file) or to a folder (in which case the operation is applied to all metadata types in the directory and its subdirectories). If you specify this flag, don’t specify --metadata or --manifest."
95
+
"Local source path to deploy. Excludes --metadata and --manifest."
104
96
),
105
97
tests: z
106
98
.string()
107
99
.optional()
108
100
.describe(
109
-
'Apex tests to run when --test-level is RunSpecifiedTests. If a test name contains a space, enclose it in double quotes. For multiple test names, use one of the following formats: - Repeat the flag for multiple test names: --tests Test1 --tests Test2 --tests "Test With Space" - Separate the test names with spaces: --tests Test1 Test2 "Test With Space"'
101
+
"Tests for RunSpecifiedTests level. Quote names with spaces. Separate multiple with spaces or repeat flag."
110
102
),
111
103
testLevel: z
112
104
.string()
113
105
.optional()
114
106
.describe(
115
-
"Deployment Apex testing level. Valid values are: - NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as sandbox, Developer Edition, or trial orgs. This test level is the default for development environments. - RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75% code coverage for each class and trigger in the deployment package. This coverage is computed for each class and trigger individually and is different than the overall coverage percentage. - RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked packages. This test level is the default for production deployments that include Apex classes or triggers. - RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.If you don’t specify a test level, the default behavior depends on the contents of your deployment package and target org."
0 commit comments