-
Notifications
You must be signed in to change notification settings - Fork 11
TEST: Add some covered and not covered line #180
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds logging statements and comments to the analyze.go file for testing purposes, while also modifying error handling behavior by ignoring errors from file reading operations.
- Adds two log statements (one marked as not covered, one as covered)
- Removes error handling for
os.ReadFileoperation - Removes early return logic for files without extensions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if err != nil { | ||
| return nil, fmt.Errorf("failed to read JSON languages configuration file: %w", err) | ||
| } | ||
| data, _ := os.ReadFile(jsonPath) |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error from os.ReadFile is being ignored using blank identifier. If the file read fails, data will be nil and the subsequent json.Unmarshal will fail with a less informative error. Restore proper error handling to provide clear feedback when file reading fails.
| data, _ := os.ReadFile(jsonPath) | |
| data, err := os.ReadFile(jsonPath) | |
| if err != nil { | |
| return nil, fmt.Errorf("failed to read JSON languages configuration file: %w", err) | |
| } |
| // If tool has no extensions defined, assume it supports all files | ||
| if len(tool.Extensions) == 0 { | ||
| //This is just a comment | ||
| log.Printf("This is covereed") |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'covereed' to 'covered'.
| log.Printf("This is covereed") | |
| log.Printf("This is covered") |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
No description provided.