Skip to content

Commit

Permalink
fix: rename camelCase rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dbale-altoros committed Dec 20, 2024
1 parent 0bab264 commit 9cb97a4
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ title: "Rule Index of Solhint"
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ------------ | ----------- |
| [interface-starts-with-i](./rules/naming/interface-starts-with-i.md) | Solidity Interfaces names should start with an `I` | | |
| [const-name-snakecase](./rules/naming/const-name-snakecase.md) | Constant name must be in capitalized SNAKE_CASE. (Does not check IMMUTABLES, use immutable-vars-naming) | $~~~~~~~~$✔️ | |
| [contract-name-camelcase](./rules/naming/contract-name-camelcase.md) | Contract, Structs and Enums should be in CamelCase. | $~~~~~~~~$✔️ | |
| [event-name-camelcase](./rules/naming/event-name-camelcase.md) | Event name must be in CamelCase. | $~~~~~~~~$✔️ | |
| [contract-name-pascalcase](./rules/naming/contract-name-pascalcase.md) | Contract, Structs and Enums should be in PascalCase. | $~~~~~~~~$✔️ | |
| [event-name-pascalcase](./rules/naming/event-name-pascalcase.md) | Event name must be in PascalCase. | $~~~~~~~~$✔️ | |
| [foundry-test-functions](./rules/naming/foundry-test-functions.md) | Enforce naming convention on functions for Foundry test cases | | |
| [func-name-mixedcase](./rules/naming/func-name-mixedcase.md) | Function name must be in mixedCase. | $~~~~~~~~$✔️ | |
| [func-named-parameters](./rules/naming/func-named-parameters.md) | Enforce named parameters for function calls with 4 or more arguments. This rule may have some false positives | | |
Expand Down
42 changes: 42 additions & 0 deletions docs/rules/naming/contract-name-pascalcase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "contract-name-pascalcase | Solhint"
---

# contract-name-pascalcase
![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen)
![Category Badge](https://img.shields.io/badge/-Style%20Guide%20Rules-informational)
![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow)
> The {"extends": "solhint:recommended"} property in a configuration file enables this rule.

## Description
Contract, Structs and Enums should be in PascalCase.

## Options
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn.

### Example Config
```json
{
"rules": {
"contract-name-pascalcase": "warn"
}
}
```

### Notes
- Solhint allows this rule to automatically fix the code with `--fix` option
- The FIX will only change first letter and remove underscores

## Examples
This rule does not have examples.

## Version
This rule is introduced in the latest version.

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/contract-name-pascalcase.js)
- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/contract-name-pascalcase.md)
- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/contract-name-pascalcase.js)
42 changes: 42 additions & 0 deletions docs/rules/naming/event-name-pascalcase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
warning: "This is a dynamically generated file. Do not edit manually."
layout: "default"
title: "event-name-pascalcase | Solhint"
---

# event-name-pascalcase
![Recommended Badge](https://img.shields.io/badge/-Recommended-brightgreen)
![Category Badge](https://img.shields.io/badge/-Style%20Guide%20Rules-informational)
![Default Severity Badge warn](https://img.shields.io/badge/Default%20Severity-warn-yellow)
> The {"extends": "solhint:recommended"} property in a configuration file enables this rule.

## Description
Event name must be in PascalCase.

## Options
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn.

### Example Config
```json
{
"rules": {
"event-name-pascalcase": "warn"
}
}
```

### Notes
- Solhint allows this rule to automatically fix the code with `--fix` option
- The FIX will only change first letter and remove underscores

## Examples
This rule does not have examples.

## Version
This rule is introduced in the latest version.

## Resources
- [Rule source](https://github.com/protofire/solhint/blob/master/lib/rules/naming/event-name-pascalcase.js)
- [Document source](https://github.com/protofire/solhint/blob/master/docs/rules/naming/event-name-pascalcase.md)
- [Test cases](https://github.com/protofire/solhint/blob/master/test/rules/naming/event-name-pascalcase.js)

0 comments on commit 9cb97a4

Please sign in to comment.