Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
safafa committed Nov 13, 2023
1 parent 7be414d commit 5f0196e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/cops.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ In the following section you find all available cops:
#### Department [Solidus](cops_solidus.md)

* [Solidus/ClassEvalDecorator](cops_solidus.md#solidusclassevaldecorator)
* [Solidus/DiscountedAmountDeprecated](cops_solidus.md#solidusdiscountedamountdeprecated)
* [Solidus/ExistingCardIdDeprecated](cops_solidus.md#solidusexistingcardiddeprecated)
* [Solidus/ReimbursementHookDeprecated](cops_solidus.md#solidusreimbursementhookdeprecated)
* [Solidus/SpreeCalculatorFreeShippingDeprecated](cops_solidus.md#solidusspreecalculatorfreeshippingdeprecated)
Expand Down
22 changes: 22 additions & 0 deletions docs/cops_solidus.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ end

* [https://github.com/solidusio/rubocop-solidus/issues/21](https://github.com/solidusio/rubocop-solidus/issues/21)

## Solidus/DiscountedAmountDeprecated

Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version
--- | --- | --- | --- | --- | ---
Enabled | Yes | No | 0.3 | - | 2.4

This cop finds .discounted_amount occurrences and suggest using .total_before_tax instead.

### Examples

```ruby
# bad
line_item.discounted_amount

# good
line_item.total_before_tax
```

### References

* [https://github.com/solidusio/rubocop-solidus/issues/31](https://github.com/solidusio/rubocop-solidus/issues/31)

## Solidus/ExistingCardIdDeprecated

Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version
Expand Down

0 comments on commit 5f0196e

Please sign in to comment.