Skip to content

Commit

Permalink
Separating lib from cli (mgechev#655)
Browse files Browse the repository at this point in the history
* Separating lib from cli

* Renamed NewRevive to New

* Added GetLintFailures helper function

* Moved formatter to call to format since that's when it's needed

* makes fields of Revive struct non-public

* minor modifs in tests: remove unnamed constats

* Added lint package management to lint command

* README message for using revive as a library

* README formatting

* Removed unused method

* Slightly improved wording in README

* Handling format errors

* Renaming file to better reflect intent

* Refactoring pattern usage

* README heads

* renames excludePaths into excludePatterns

Co-authored-by: Bernardo Heynemann <bernardo.heynemann@coinbase.com>
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
Signed-off-by: subham sarkar <subham@deepsource.io>
  • Loading branch information
3 people authored and subham-deepsource committed Aug 5, 2022
1 parent 2af32ac commit 419bba3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -608,9 +608,15 @@ You can still go further and use `revive` without its cli, as part of your libra
package mylib

import (
<<<<<<< HEAD
"github.com/deepsourcelabs/revive/cli"
"github.com/deepsourcelabs/revive/revivelib"
"github.com/deepsourcelabs/revive/lint"
=======
"github.com/mgechev/revive/cli"
"github.com/mgechev/revive/revivelib"
"github.com/mgechev/revive/lint"
>>>>>>> 318db94 (Separating lib from cli (#655))
)

// Error checking removed for clarity
Expand All @@ -622,7 +628,11 @@ func LintMyFile(file string) {
true, // Set exit status
2048, // Max open files

<<<<<<< HEAD
// Then add as many extra rules as you need
=======
// Then add as many extra rules as you need
>>>>>>> 318db94 (Separating lib from cli (#655))
revivelib.NewExtraRule(&myRule{}, lint.RuleConfig{}),
)

Expand Down Expand Up @@ -755,6 +765,12 @@ REVIVE_FORCE_COLOR=1 revive -formatter friendly ./... | tee revive.log
:---: |:---: |:---: |:---: |:---: |
[cce](https://github.com/cce) |[haya14busa](https://github.com/haya14busa) |[jmckenzieark](https://github.com/jmckenzieark) |[techknowlogick](https://github.com/techknowlogick) |[zeripath](https://github.com/zeripath) |


[<img alt="heynemann" src="https://avatars.githubusercontent.com/u/60965?v=4&s=117" width="117">](https://github.com/heynemann) | | | | | |
|:---: |:---: |:---: |:---: |:---: |:---: |
[heynemann](https://github.com/heynemann) | | | | | |


## License

MIT

0 comments on commit 419bba3

Please sign in to comment.