kibit
kibit copied to clipboard
Allow custom rules
- 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
@danielcompton I think all the things have been fixed according to your comments. Would it be possible to get this change merged ?
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.
Hey Daniel, Take your time.
I've merged this. Thanks!
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)?
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
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.
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