Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: @W-17100389@: Add in feedback url to help text and log #1674

Merged
merged 2 commits into from
Nov 15, 2024
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
2 changes: 2 additions & 0 deletions messages/config-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Code Analyzer gives you the ability to configure settings that modify Code Analy

To apply a custom configuration with Code Analyzer, either keep your custom configuration settings in a `code-analyzer.yml` file located in the current folder from which you are executing commands, or specify the location of your custom configuration file to the Code Analyzer commands with the --config-file flag.

We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at http://sfdc.co/CodeAnalyzerFeedback.

# command.examples

- Display the current state of the Code Analyzer configuration using the default behavior: display top level configuration, display the engine and rule override settings associated with all the rules that have a "Recommended" tag; and automatically apply any existing custom configuration settings found in a `code-analyzer.yml` or `code-analyzer.yaml` file in the current folder:
Expand Down
4 changes: 2 additions & 2 deletions messages/path-start-util.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# error.glob-method-conflict

*DRAFT*: Path start point %s is invalid: When specifying a method with the #methodName syntax, glob patterns cannot be used.
Path start point %s is invalid: You can't use glob patterns when specifying a method with the #methodName syntax.

# error.negative-globs-unsupported

*DRAFT*: Path start point %s is invalid: Negative globs are unsupported.
Path start point %s is invalid: Negative globs are unsupported.
2 changes: 2 additions & 0 deletions messages/rules-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ You can also view details about the rules, such as the engine it's associated wi

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.

We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at http://sfdc.co/CodeAnalyzerFeedback.

# command.examples

- List rules using the default behavior: include rules from all engines that have a "Recommended" tag; display the rules using concise table format; and automatically apply rule or engine overrides if a "code-analyzer.yml" or "code-analyzer.yaml" file exists in the current folder:
Expand Down
2 changes: 2 additions & 0 deletions messages/run-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ You can scan your codebase with the recommended rules. Or use flags to filter th

If you want to preview the list of rules before you actually run them, use the `code-analyzer rules` command, which also has the "--rules-selector", "--workspace", and "--config-file" flags that together define the list of rules to be run.

We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at http://sfdc.co/CodeAnalyzerFeedback.

# command.examples

- Analyze code using the default behavior: analyze the files in the current folder (default workspace) using the Recommended rules; display the output in the terminal with the concise table view; and automatically apply rule or engine overrides if a "code-analyzer.yml" or "code-analyzer.yaml" file exists in the current folder:
Expand Down
4 changes: 4 additions & 0 deletions messages/shared.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ Developer Preview
# warning.command-state

This command is in %s.

# log.give-us-feedback

We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at http://sfdc.co/CodeAnalyzerFeedback.
2 changes: 1 addition & 1 deletion messages/workspace-util.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# error.negative-globs-unsupported

*DRAFT*: Workspace path %s is invalid: Negative globs are unsupported.
Workspace path %s is invalid: Negative globs are unsupported.
2 changes: 2 additions & 0 deletions src/lib/listeners/LogEventListener.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {CodeAnalyzer, EngineLogEvent, EventType, LogEvent, LogLevel} from '@salesforce/code-analyzer-core';
import {Display} from '../Display';
import {LogWriter} from '../writers/LogWriter';
import {BundleName, getMessage} from "../messages";

export interface LogEventListener {
listen(codeAnalyzer: CodeAnalyzer): void;
Expand Down Expand Up @@ -58,6 +59,7 @@ export class LogEventLogger implements LogEventListener {
}

public stopListening(): void {
this.logWriter.writeToLog('\n' + getMessage(BundleName.Shared, 'log.give-us-feedback'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Is it okay for this to be a raw string without a log-level, source, etc? I know that conceptually it doesn't have those things, but I'm just unsure of whether logging something that lacks them could interfere with displaying or filtering logs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a good question. I had the same thought. I'm not sure if the goal is to make the logs machine readable or not. If so - then we'd need to adjust the formatting to be more deterministic since currently messages can already go to multiple lines and possibly corrupt the formatting.

I currently don't think we need the log to be machine readable - my guess is that it will always just be for human readability when diagnosing issues. So I think having a newline plus a plain string works here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

this.logWriter.closeLog();
}

Expand Down