Skip to content
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

Add settings to enable or disable some rules on demand #18

Merged

Conversation

manuelarte
Copy link
Owner

@manuelarte manuelarte commented Mar 28, 2025

This PR adds the possibility to enable or disable some "checks" in the funcorder linter.

Right now the linter checks the following:

  • Struct's Constructors are placed after struct declaration.
  • Struct's Constructors are placed before the struct's method declaration.
  • Non-exported struct's methods are placed after exported ones.

But, I did not add 3 settings to enable/disable these checks, I only added two:

  • constructor-check: Enable/Disable checks for bullet points 1 and 2.
  • struct-method-check: Enable/Disable checks for bullet point 3.

Close #17

What do you guys think?

Work Pending:

@manuelarte manuelarte linked an issue Mar 28, 2025 that may be closed by this pull request
@manuelarte manuelarte added the enhancement New feature or request label Mar 28, 2025
Copy link
Collaborator

@alexandear alexandear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose adding documentation to README.md for these options.

@ldez ldez unassigned alexandear and ldez Mar 28, 2025
@ldez ldez self-requested a review March 28, 2025 11:41
@ldez ldez changed the title 17 add settings to enable or disable some rules on demand Add settings to enable or disable some rules on demand Mar 28, 2025
@manuelarte
Copy link
Owner Author

I propose adding documentation to README.md for these options.

I updated it with the following:

> funcorder [--constructor-check true|false] [--struct-methods-check true|false] ./...

Parameters:
* constructor-check: `true|false` (default `true`) enable|disable check constructor is placed after struct declaration and before struct's methods.
* struct-methods-check: `true|false` (default `true`) enable|disable check exported struct's methods are declared before non-exported.

@manuelarte manuelarte requested review from alexandear and ldez March 28, 2025 13:00
@ldez
Copy link
Collaborator

ldez commented Mar 28, 2025

FYI, I'm working on a refactor, I will open a PR after the merge of this one.

@manuelarte
Copy link
Owner Author

manuelarte commented Mar 28, 2025

FYI, I'm working on a refactor, I will open a PR after the merge of this one.

amazing, looking forward to check it. If you approve this one we can merge it, I think all the points were resolved.

Copy link
Collaborator

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (but some elements will be refactored)

@manuelarte manuelarte merged commit a1e9216 into main Mar 28, 2025
9 checks passed
@manuelarte manuelarte deleted the 17-add-settings-to-enable-or-disable-some-rules-on-demand branch March 28, 2025 18:04
@manuelarte
Copy link
Owner Author

LGTM (but some elements will be refactored)

merged. I will wait for the refactor to release v0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add settings to enable or disable some rules on demand
3 participants