Skip to content

Commit

Permalink
Adding info about the 3rd party Gradle plugin (#438)
Browse files Browse the repository at this point in the history
* Changed formatting of headers

* Link to eugene's plugin
  • Loading branch information
mccartney authored Oct 8, 2020
1 parent 9076199 commit 3e64734
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ A static code analyzer is a tool that flag suspicious language usage in code. Th

Scalastyle is a similar linting tool which focuses mostly on enforcing style/code standards. There's no problems running multiple analysis tools on the same codebase. In fact it could be beneficial as the total set of possible warnings is the union of the inspections of all the enabled tools. The worst case is that the same warnings might be generated by multiple tools.

### Usage
## Usage
Scapegoat is developed as a scala compiler plugin, which can then be used inside your build tool.

#### SBT
### SBT
See: [sbt-scapegoat](https://github.com/sksamuel/sbt-scapegoat) for SBT integration.

#### Maven
### Maven

Firstly you need to add scapegoat plugin as a dependency:

Expand Down Expand Up @@ -63,7 +63,11 @@ You can pass other configuration flags same way, e.g.

Note: You may use a separate maven profile, so that the dependency doesn't go to you runtime classpath.

#### Gradle
### Gradle with a plugin

Use [gradle-scapegoat-plugin by @eugene-sy](https://github.com/eugene-sy/gradle-scapegoat-plugin)

### Gradle - manually

Firstly you need to add scapegoat plugin as a dependency:

Expand Down Expand Up @@ -99,7 +103,7 @@ You can pass other configuration flags adding it to the `additionalParameters` l

`"-P:scapegoat:disabledInspections:FinalModifierOnCaseClass"`

#### Full list of compiler flags
## Full list of compiler flags

| Flag | Parameters | Required |
|------|------------|----------|
Expand All @@ -115,7 +119,7 @@ You can pass other configuration flags adding it to the `additionalParameters` l
|`-P:scapegoat:sourcePrefix:`|Overrides source prefix if it differs from `src/main/scala`, for ex. `app/` for Play applications.|false|
|`-P:scapegoat:minimalLevel:`|Provides minimal level of inspection displayed in reports and in the console.|false|

### Reports
## Reports

Here is sample output from the console during the build for a project with warnings/errors:

Expand All @@ -134,7 +138,7 @@ And if you prefer a prettier report, here is a screen shot of the type of HTML r

![screenshot](https://raw.githubusercontent.com/sksamuel/scapegoat/master/screenshot1.png)

### Configuration
## Configuration

For instructions on suppressing warnings by file, by inspection or by line see [the sbt-scapegoat README](https://github.com/sksamuel/sbt-scapegoat).

Expand Down Expand Up @@ -351,7 +355,7 @@ class Test2 {
```


### Other static analysis tools:
## Other static analysis tools:

* ScalaStyle (Scala) - https://github.com/scalastyle/scalastyle/wiki
* Linter (Scala) - https://github.com/HairyFotr/linter
Expand Down

0 comments on commit 3e64734

Please sign in to comment.