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

Allow custom rules #139

Closed

Conversation

kapilreddy
Copy link
Contributor

  • Modify run and external-run to accept custom rules
  • Create unifier/prep'ed rules inside check-expr and check-reader. This
    makes passing custom rules simpler

Create unifier/prep'ed rules inside check-expr and check-reader. This
makes passing custom rules simpler
:reporter (name-to-reporter (:reporter options)
cli-reporter)
:rules (or rules all-rules))
(catch Exception e
Copy link
Member

Choose a reason for hiding this comment

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

Can you make indentation match the previous usage here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure what you mean by that. A code block would help.

Copy link
Member

Choose a reason for hiding this comment

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

The previous catch block was indented inline with the start of (check-file. So:

(try (check-file ...)
     (catch Exception e ...))

@kapilreddy
Copy link
Contributor Author

@danielcompton I think all the things have been fixed according to your comments. Would it be possible to get this change merged ?

@danielcompton
Copy link
Member

Hey sorry I haven't had the chance to sit down and look at this properly yet, my weekend was full. I hope to get to this in the next week or so. Sorry for the delay.

@kapilreddy
Copy link
Contributor Author

Hey Daniel, Take your time.

@danielcompton
Copy link
Member

I've merged this. Thanks!

@marksto
Copy link
Contributor

marksto commented Sep 13, 2021

Hi @danielcompton! This one still isn't merged and it looks like an accident. Are there any plans to finally merge this one together with the #141 (a #140-related PR with the documentation update)?

@port19x
Copy link
Contributor

port19x commented Apr 18, 2023

I'm not convinced this is a good idea.
If you're competent enough and familiar enough with kibit to write your own custom rule, surely it wouldn't be much of a stretch to assume you could fork the project.
That way you could also open a PR and contribute back to the project more easily.
It would be a shame if through custom rules we have several people implement the same good custom rule that should really be upstream

@NoahTheDuke
Copy link
Collaborator

Counterpoint: using kibit on a specialized or closed-source codebase (at a job, in a personal project, etc) will have opportunities for helpful custom rules that 1) aren't generally useful and/or 2) can't even be shared due to privacy/copyright concerns.

For example, I want to migrate my codebase from using two custom functions to a single unified custom function. There's no need for kibit in general to have a (func2 (func1 ?arg1 ?arg2)) (unified-func ?arg1 ?arg2)) rule.

@port19x
Copy link
Contributor

port19x commented Apr 19, 2023

Counterpoint: using kibit on a specialized or closed-source codebase (at a job, in a personal project, etc) will have opportunities for helpful custom rules that 1) aren't generally useful and/or 2) can't even be shared due to privacy/copyright concerns.

For example, I want to migrate my codebase from using two custom functions to a single unified custom function. There's no need for kibit in general to have a (func2 (func1 ?arg1 ?arg2)) (unified-func ?arg1 ?arg2)) rule.

Valid point!
I totally forgot that you might want to have rules for functions outside of clojure.core, especially in larger codebases

@NoahTheDuke
Copy link
Collaborator

Closing this PR in light of kibit entering maintenance status. (See this comment for further details.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants