You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
Seems like we are ready to have some tasty tool to generate jscs configs for different projects by samples.
I see that we can group rules by it's application and then just fill complete matrix with 0s and 1s to each rule sets. On each step we just enable 1 rule of each group, test code sample, and if there is no error then set 1 to that rule. If there is an error then set -1 (or 0). Finally when all test cases will be done we just select right rule of each group with right value.
Some complex rules with non-boolean values can be just ignored and specified manually later. But also it can be calculated by special callbacks (e.g. tabs or spaces?).
What you think?
The text was updated successfully, but these errors were encountered:
+1 Love the idea. The proposed implementation sounds like it could work; although, it assumes that a sample is representative enough of the entire codebase to properly assume the rules to set.
Perhaps this could be extended to an entire codebase where we spawn forks to gather the proposed configs on a per-file basis then the master process could determine the rules to set by the majority. e.g., if 90% of the modules agree on a particular rule's configuration, then that's the configuration to use.
This would make a nice generator tool outside of the jscs codebase. That tool could get access to the jscs ruleset by requiring it as a dependency and looking into node_modules/jscs/lib/rules. Not too pretty, but it works. Unless, there's a way to require('jscs') and then get access to the _activeRules.
Seems like we are ready to have some tasty tool to generate
jscs
configs for different projects by samples.I see that we can group rules by it's application and then just fill complete matrix with 0s and 1s to each rule sets. On each step we just enable 1 rule of each group, test code sample, and if there is no error then set 1 to that rule. If there is an error then set -1 (or 0). Finally when all test cases will be done we just select right rule of each group with right value.
Some complex rules with non-boolean values can be just ignored and specified manually later. But also it can be calculated by special callbacks (e.g. tabs or spaces?).
What you think?
The text was updated successfully, but these errors were encountered: