-
Notifications
You must be signed in to change notification settings - Fork 58
Propose a more consistent output message format (and hopefully simpler coding of future rules) #475
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
Changes from all commits
13c176d
38f96ec
b0d81e8
457f149
5c43612
6d6f61f
db1a1b2
c980eeb
d2e6aab
5014a1c
422a2e6
3ad9df6
744b8c8
e8972eb
4d77546
07ea108
e6cf143
59aba68
3d9ceaf
45dc4e9
ff89ced
c58616e
7abfc1e
8be6add
2a7e6be
adbaf1a
67cfcc3
98acb67
59d8511
51f23e2
b0d8678
abe65ef
37536b0
9e0c685
1f34258
2720d30
6989b9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| # God Modules  | ||
|
|
||
| The number of functions in a module should be limited to a maximum threshold. | ||
| The number of exported functions in a module should be limited to a maximum threshold. | ||
|
Collaborator
Author
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. We're actually only counting exported. Do we want an option for total (?)
Collaborator
Author
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. And actually that's not entirely true, since we're not looking at the actual exported functions, but the export nodes (if you're using
Collaborator
Author
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. (in 1/2 new issues, that is, not in this pull request)
Member
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. Well… Usage of Regarding internal functions: When @marcelog came up with this rule, he was very intentional in only checking exported functions. The idea of the rule is not to prevent you from writing many functions in a module (quite the contrary, writing a module with many small functions instead of few large ones is preferrable), but to warn you if your module has too many responsibilities (i.e., it can be functionally split into multiple modules). I think the rule is fine as it is.
Collaborator
Author
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. Cool, then we might need to adjust the documentation, just...
Collaborator
Author
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. Change pushed. (for clarity) |
||
|
|
||
| ## Rationale | ||
|
|
||
| Limiting the number of functions in a module helps maintain clarity, modularity, and readability | ||
| in the codebase. A module with too many functions can become difficult to navigate, understand, | ||
| and maintain. By restricting the number of functions, you encourage smaller, more focused modules | ||
| that adhere to the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single-responsibility_principle) | ||
| Limiting the number of functions exported from a module helps maintain clarity, modularity, and | ||
| readability in the codebase. A module with too many exported functions can become difficult to | ||
| consume and understand, from an API perspective. By restricting the number of exported functions, | ||
| you encourage smaller, more focused modules that adhere to the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single-responsibility_principle) | ||
| (SRP). This also makes the code easier to test, debug, and extend. | ||
|
|
||
| ## Options | ||
|
|
||
elbrujohalcon marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.