-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
Merge experimental / refactor #146
Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
9b08174
Process via packages instead of files
gcmurphy 8df48f9
Fix to reporting to use output formats
gcmurphy cacf21f
Restructure to focus on lib rather than cli
gcmurphy bf78d02
Restructure and introduce a standalone config
gcmurphy 50bbc53
Isolate import tracking functionality
gcmurphy 5160048
Move rule definitions into own file
gcmurphy 65b18da
Hack to address circular dependency in rulelist
gcmurphy 026fe4c
Simplify analyzer and command line interface
gcmurphy f4b705a
Use glide to manage vendored dependencies
gcmurphy 6943f9e
Major rework of codebase
gcmurphy 3caf7c3
Add test cases
gcmurphy 9c959ca
Issue.Line is already a string
lanzafame 5a11336
remove commited binary
lanzafame 27b2fd9
Merge pull request #136 from lanzafame/experimental
gcmurphy 67dc432
use godep instead of glide
gcmurphy d4311c9
make it clear that these tests have not been implemented yet
gcmurphy 02901b9
actually skip tests until implementation exists
gcmurphy e3b6fd9
update readme to provide info regarding package level scans
gcmurphy 97cde35
update travis-ci to use ginkgo tests
gcmurphy cfa4327
fix hound-ci errors
gcmurphy af25ac1
fix golint errors picked up by hound-ci
gcmurphy 25d74c6
address review comments
gcmurphy e925d3c
Migrated old test cases.
gcmurphy 4c49716
move utils to separate executable
gcmurphy d452dcb
Fix ginko invocation
gcmurphy 867d300
Fix lint issues
gcmurphy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix to reporting to use output formats
- Loading branch information
commit 8df48f97698f07e3ac65ed2d5854cf9fc65ae0b7
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
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 |
---|---|---|
|
@@ -48,7 +48,16 @@ Summary: | |
|
||
` | ||
|
||
func CreateReport(w io.Writer, format string, data *gas.Analyzer) error { | ||
type reportInfo struct { | ||
Issues []*gas.Issue | ||
Stats *gas.Metrics | ||
} | ||
|
||
func CreateReport(w io.Writer, format string, issues []*gas.Issue, metrics *gas.Metrics) error { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exported function CreateReport should have comment or be unexported |
||
data := &reportInfo{ | ||
Issues: issues, | ||
Stats: metrics, | ||
} | ||
var err error | ||
switch format { | ||
case "json": | ||
|
@@ -65,7 +74,7 @@ func CreateReport(w io.Writer, format string, data *gas.Analyzer) error { | |
return err | ||
} | ||
|
||
func reportJSON(w io.Writer, data *gas.Analyzer) error { | ||
func reportJSON(w io.Writer, data *reportInfo) error { | ||
raw, err := json.MarshalIndent(data, "", "\t") | ||
if err != nil { | ||
panic(err) | ||
|
@@ -78,7 +87,7 @@ func reportJSON(w io.Writer, data *gas.Analyzer) error { | |
return err | ||
} | ||
|
||
func reportCSV(w io.Writer, data *gas.Analyzer) error { | ||
func reportCSV(w io.Writer, data *reportInfo) error { | ||
out := csv.NewWriter(w) | ||
defer out.Flush() | ||
for _, issue := range data.Issues { | ||
|
@@ -97,7 +106,7 @@ func reportCSV(w io.Writer, data *gas.Analyzer) error { | |
return nil | ||
} | ||
|
||
func reportFromPlaintextTemplate(w io.Writer, reportTemplate string, data *gas.Analyzer) error { | ||
func reportFromPlaintextTemplate(w io.Writer, reportTemplate string, data *reportInfo) error { | ||
t, e := plainTemplate.New("gas").Parse(reportTemplate) | ||
if e != nil { | ||
return e | ||
|
@@ -106,7 +115,7 @@ func reportFromPlaintextTemplate(w io.Writer, reportTemplate string, data *gas.A | |
return t.Execute(w, data) | ||
} | ||
|
||
func reportFromHTMLTemplate(w io.Writer, reportTemplate string, data *gas.Analyzer) error { | ||
func reportFromHTMLTemplate(w io.Writer, reportTemplate string, data *reportInfo) error { | ||
t, e := htmlTemplate.New("gas").Parse(reportTemplate) | ||
if e != nil { | ||
return e | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
exported function CreateReport should have comment or be unexported