-
Notifications
You must be signed in to change notification settings - Fork 74
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
Inherit a ruleset from another ruleset #21
Comments
Realizing that my reference was about making a rule extend another rule (ie: stop copy and paste between rules); whereas this is about cascading rulesets themselves. |
I'm particularly interested in seeing this implemented for use here at Twitter. Would this not be as simple as a new "extends" field in the ruleset, and then recursively deep merging the sets? A child ruleset could override a rule from a parent by setting I, or someone on my team, may take a look at providing a PR for this, I just wanted to make sure I wasn't missing anything. |
Actually, that might not work if you're wanting to, for example, remove a value from an options array . By default, I suspect it would combine the arrays. Maybe a shallow merge then of just the top-level rules? That would still result in some duplicating if you're just wanting to change the configuration of an existing rule, but makes it trivial to add new rules, and is still better than what we have today. |
Your suggestion is the direction I would have gone, don't think you're missing anything significant there. |
Currently, logic for loading configuration files is split between bin/repolinter.js (for loading URLs) and index.js (for local files, directories, and the default config). This commit refactors all configuration loading logic into a new lib/config.js module, which handles loading and validating config files of all types. This will make it simpler to extend config loading logic, for example to support inheriting rulesets (todogroup#21). This does have minor changes on the error messages returned by the CLI in some cases. It also attempts to parse all config files as JSON first and then YAML, regardless of file extensions (this was previously different for remote versus local config files). This does not change anything in repolinter's programmatic API.
Currently, logic for loading configuration files is split between bin/repolinter.js (for loading URLs) and index.js (for local files, directories, and the default config). This commit refactors all configuration loading logic into a new lib/config.js module, which handles loading and validating config files of all types (existing parseConfig and validateConfig functions were moved as-is). This will make it simpler to extend config loading logic, for example to support inheriting rulesets (todogroup#21). This does have minor changes on the error messages returned by the CLI in some cases. It also attempts to parse all config files as JSON first and then YAML, regardless of file extensions (this was previously different for remote versus local config files). This does not change anything in repolinter's programmatic API.
Currently, logic for loading configuration files is split between bin/repolinter.js (for loading URLs) and index.js (for local files, directories, and the default config). This commit refactors all configuration loading logic into a new lib/config.js module, which handles loading and validating config files of all types (existing parseConfig and validateConfig functions were moved as-is). This will make it simpler to extend config loading logic, for example to support inheriting rulesets (todogroup#21). This does have minor changes on the error messages returned by the CLI in some cases. It also attempts to parse all config files as JSON first and then YAML, regardless of file extensions (this was previously different for remote versus local config files). This does not change anything in repolinter's programmatic API.
Currently, logic for loading configuration files is split between bin/repolinter.js (for loading URLs) and index.js (for local files, directories, and the default config). This commit refactors all configuration loading logic into a new lib/config.js module, which handles loading and validating config files of all types (existing parseConfig and validateConfig functions were moved as-is). This will make it simpler to extend config loading logic, for example to support inheriting rulesets (todogroup#21). This does have minor changes on the error messages returned by the CLI in some cases. It also attempts to parse all config files as JSON first and then YAML, regardless of file extensions (this was previously different for remote versus local config files). This does not change anything in repolinter's programmatic API.
Currently, logic for loading configuration files is split between bin/repolinter.js (for loading URLs) and index.js (for local files, directories, and the default config). This commit refactors all configuration loading logic into a new lib/config.js module, which handles loading and validating config files of all types (existing parseConfig and validateConfig functions were moved as-is). This will make it simpler to extend config loading logic, for example to support inheriting rulesets (todogroup#21). This does have minor changes on the error messages returned by the CLI in some cases. It also attempts to parse all config files as JSON first and then YAML, regardless of file extensions (this was previously different for remote versus local config files). This does not change anything in repolinter's programmatic API.
Currently, logic for loading configuration files is split between bin/repolinter.js (for loading URLs) and index.js (for local files, directories, and the default config). This commit refactors all configuration loading logic into a new lib/config.js module, which handles loading and validating config files of all types (existing parseConfig and validateConfig functions were moved as-is). This will make it simpler to extend config loading logic, for example to support inheriting rulesets (todogroup#21). This does have minor changes on the error messages returned by the CLI in some cases. It also attempts to parse all config files as JSON first and then YAML, regardless of file extensions (this was previously different for remote versus local config files). This does not change anything in repolinter's programmatic API.
Currently, logic for loading configuration files is split between bin/repolinter.js (for loading URLs) and index.js (for local files, directories, and the default config). This commit refactors all configuration loading logic into a new lib/config.js module, which handles loading and validating config files of all types (existing parseConfig and validateConfig functions were moved as-is). This will make it simpler to extend config loading logic, for example to support inheriting rulesets (todogroup#21). This does have minor changes on the error messages returned by the CLI in some cases. It also attempts to parse all config files as JSON first and then YAML, regardless of file extensions (this was previously different for remote versus local config files). This does not change anything in repolinter's programmatic API.
* refactor configuration loading logic Currently, logic for loading configuration files is split between bin/repolinter.js (for loading URLs) and index.js (for local files, directories, and the default config). This commit refactors all configuration loading logic into a new lib/config.js module, which handles loading and validating config files of all types (existing parseConfig and validateConfig functions were moved as-is). This will make it simpler to extend config loading logic, for example to support inheriting rulesets (#21). This does have minor changes on the error messages returned by the CLI in some cases. It also attempts to parse all config files as JSON first and then YAML, regardless of file extensions (this was previously different for remote versus local config files). This does not change anything in repolinter's programmatic API. * add 'extends' property for extending ruleset
I think #207 should've closed this, so I'll go ahead and do that. |
# [0.9.0](v0.8.2...v0.9.0) (2023-02-17) ### Bug Fixes * add backwards compatibility for blacklist -> denylist switch ([002deae](002deae)) * add command-exists test to axioms for stability, moved from sync to async calls ([todogroup#182](https://github.com/newrelic-forks/repolinter/issues/182)) ([0da11b9](0da11b9)) * add missing github-markup dependencies to dockerfile ([b5fb88a](b5fb88a)) * attempt to fix timeout on MacOS when running axioms ([05e81ad](05e81ad)) * broken test case. ([4816a53](4816a53)) * explicitly check-out the forked repo for release job ([5c7d05b](5c7d05b)) * file-hash now accepts legacy configuration format ([d509274](d509274)) * fix axiom object with invalid axiom ([11e7048](11e7048)) * fix broken link behavrior with files in subdirectories ([6c14db9](6c14db9)) * fix flaky glob behavior with broken symlinks ([57c0dfd](57c0dfd)) * fix path seperator in symlink detection ([3898ed5](3898ed5)) * fix pathing issues and succeed/fail criteria with no files found ([c0c101b](c0c101b)) * jsdoc initial rules ([d200c51](d200c51)) * minor updates to the markdown formatter ([todogroup#180](https://github.com/newrelic-forks/repolinter/issues/180)) ([45ee596](45ee596)) * move command-exists to dependencies ([72abd8a](72abd8a)) * remove accidental shadowing of fs ([d5d6359](d5d6359)) * remove lstat check, fix flakey fs tests ([a154a89](a154a89)) * remove npm from plugins ([a628f6c](a628f6c)) * remove Object.fromEntries for node 10 support ([0644374](0644374)) * schema $id mixup. ([6bc0828](6bc0828)) * strip quotes from stringified content ([5222510](5222510)) * switch to canonical broken-link-checker ([todogroup#205](https://github.com/newrelic-forks/repolinter/issues/205)) ([e62d767](e62d767)) * undo change ([cd23a3a](cd23a3a)) * undo change ([33d6384](33d6384)) * update action to semantic-relase v19.0.5 is used ([b043a24](b043a24)) * update axioms, fixes and rules for documentation ([7432dfe](7432dfe)) * update base image ([1d0a938](1d0a938)) * update dockerfile to fix bad copying ([todogroup#224](https://github.com/newrelic-forks/repolinter/issues/224)) ([92389be](92389be)) * update dockerfile to reconfigure bundle which (may) have caused some bugs on linux ([889da3e](889da3e)) * update github-markup to remove python2 dependency ([todogroup#209](https://github.com/newrelic-forks/repolinter/issues/209)) ([0c7c50c](0c7c50c)) * update JSON schema URLs to point to TODOGroup repo ([9d397ef](9d397ef)) * update test case for 'fail-on-non-existent' scenario, the 'passed' of non-exist file should depend on the parameter. ([e31bfb3](e31bfb3)) * upgrade broken-link-checker to add node 10 support ([4f00b33](4f00b33)) * upgrade ruby gems to latest version ([e36c10a](e36c10a)) * windows compatibility fixes ([8fc0540](8fc0540)) * windows fixes ([d52353e](d52353e)) ### Features * add 'files-not-contents' rule to make string detection rulesets easier to maintain. ([093afc3](093afc3)) * add better regex context support for file-contents ([2ff65d1](2ff65d1)) * add file-not-exists rule ([184b787](184b787)) * add file-not-exists rule ([todogroup#183](https://github.com/newrelic-forks/repolinter/issues/183)) ([ebca0b1](ebca0b1)) * add file-remove fix ([04743ce](04743ce)) * add file-remove fix ([todogroup#181](https://github.com/newrelic-forks/repolinter/issues/181)) ([ee913b3](ee913b3)) * add files-not-hash rule for files detections. ([d2f262a](d2f262a)) * add large file rules ([2e48a85](2e48a85)) * add lines of regex match in the file-contents and file-not-contents rule output, default turned off. ([9831684](9831684)) * add policyUrl and policyInfo in the default output. ([fb81866](fb81866)) * add support for inheriting rulesets ([todogroup#207](https://github.com/newrelic-forks/repolinter/issues/207)) ([ca1ae01](ca1ae01)), closes [todogroup#21](https://github.com/newrelic-forks/repolinter/issues/21) * add YAML support in config ([fb6c743](fb6c743)) * finalize no broken links rule and dockerfile ([c1b1f72](c1b1f72)) * merge contributor-count axiom into fork ([f3dc857](f3dc857)) * **no-broken-links:** add option to pass or not pass in external links ([aaa92f8](aaa92f8)) * switch to fork of broken-link-checker ([7df3086](7df3086)) * update dockerfile to reflect new dependencies ([c256af7](c256af7)) * WIP adding a broken link checker rule ([9e8bb98](9e8bb98))
# 1.0.0 (2024-08-17) ### Bug Fixes * add backwards compatibility for blacklist -> denylist switch ([002deae](002deae)) * add command-exists test to axioms for stability, moved from sync to async calls ([todogroup#182](https://github.com/zhaoyuheng200/repolinter/issues/182)) ([0da11b9](0da11b9)) * add docs directory ([0ccdcd8](0ccdcd8)) * add missing github-markup dependencies to dockerfile ([b5fb88a](b5fb88a)) * attempt to fix timeout on MacOS when running axioms ([05e81ad](05e81ad)) * broken test case. ([4816a53](4816a53)) * **code-of-conduct:** match CODE_OF_CONDUCT* as well ([8892334](8892334)) * **dependencies:** update vulnerable packages ([#1](#1)) ([28a6135](28a6135)), closes [/github.com/sinonjs/sinon/blob/master/CHANGELOG.md#412--2017-11-07](https://github.com//github.com/sinonjs/sinon/blob/master/CHANGELOG.md/issues/412--2017-11-07) * file-hash now accepts legacy configuration format ([d509274](d509274)) * fix axiom object with invalid axiom ([11e7048](11e7048)) * fix broken link behavrior with files in subdirectories ([6c14db9](6c14db9)) * fix flaky glob behavior with broken symlinks ([57c0dfd](57c0dfd)) * fix path seperator in symlink detection ([3898ed5](3898ed5)) * fix pathing issues and succeed/fail criteria with no files found ([c0c101b](c0c101b)) * jsdoc initial rules ([d200c51](d200c51)) * **licensee:** isWindows is a function ([09a772b](09a772b)) * make license-headers-exist reuse.software compatible ([3739198](3739198)) * minor updates to the markdown formatter ([todogroup#180](https://github.com/zhaoyuheng200/repolinter/issues/180)) ([45ee596](45ee596)) * move command-exists to dependencies ([72abd8a](72abd8a)) * remove accidental shadowing of fs ([d5d6359](d5d6359)) * remove lstat check, fix flakey fs tests ([a154a89](a154a89)) * remove Object.fromEntries for node 10 support ([0644374](0644374)) * schema $id mixup. ([6bc0828](6bc0828)) * switch to canonical broken-link-checker ([todogroup#205](https://github.com/zhaoyuheng200/repolinter/issues/205)) ([e62d767](e62d767)) * undo change ([cd23a3a](cd23a3a)) * undo change ([33d6384](33d6384)) * update axioms, fixes and rules for documentation ([7432dfe](7432dfe)) * update dockerfile to fix bad copying ([todogroup#224](https://github.com/zhaoyuheng200/repolinter/issues/224)) ([92389be](92389be)) * update dockerfile to reconfigure bundle which (may) have caused some bugs on linux ([889da3e](889da3e)) * update github-markup to remove python2 dependency ([todogroup#209](https://github.com/zhaoyuheng200/repolinter/issues/209)) ([0c7c50c](0c7c50c)) * update JSON schema URLs to point to TODOGroup repo ([9d397ef](9d397ef)) * update test case for 'fail-on-non-existent' scenario, the 'passed' of non-exist file should depend on the parameter. ([e31bfb3](e31bfb3)) * upgrade broken-link-checker to add node 10 support ([4f00b33](4f00b33)) * upgrade ruby gems to latest version ([e36c10a](e36c10a)) * windows compatibility fixes ([8fc0540](8fc0540)) * windows fixes ([d52353e](d52353e)) ### Features * add 'files-not-contents' rule to make string detection rulesets easier to maintain. ([093afc3](093afc3)) * add better regex context support for file-contents ([2ff65d1](2ff65d1)) * add file-not-exists rule ([184b787](184b787)) * add file-not-exists rule ([todogroup#183](https://github.com/zhaoyuheng200/repolinter/issues/183)) ([ebca0b1](ebca0b1)) * add file-remove fix ([04743ce](04743ce)) * add file-remove fix ([todogroup#181](https://github.com/zhaoyuheng200/repolinter/issues/181)) ([ee913b3](ee913b3)) * add files-not-hash rule for files detections. ([d2f262a](d2f262a)) * add large file rules ([2e48a85](2e48a85)) * add lines of regex match in the file-contents and file-not-contents rule output, default turned off. ([9831684](9831684)) * add policyUrl and policyInfo in the default output. ([fb81866](fb81866)) * add relative path resolving to rulesetPath ([561e895](561e895)) * add support for inheriting rulesets ([todogroup#207](https://github.com/zhaoyuheng200/repolinter/issues/207)) ([ca1ae01](ca1ae01)), closes [todogroup#21](https://github.com/zhaoyuheng200/repolinter/issues/21) * add YAML support in config ([fb6c743](fb6c743)) * finalize no broken links rule and dockerfile ([c1b1f72](c1b1f72)) * merge contributor-count axiom into fork ([f3dc857](f3dc857)) * **no-broken-links:** add option to pass or not pass in external links ([aaa92f8](aaa92f8)) * switch to fork of broken-link-checker ([7df3086](7df3086)) * update dockerfile to reflect new dependencies ([c256af7](c256af7)) * update github pull request template locations ([c2d0f40](c2d0f40)) * WIP adding a broken link checker rule ([9e8bb98](9e8bb98))
Today the only way to customize the rules is to copy the default ruleset and edit it... You should be able to create a ruleset that extends a ruleset and add new rules or change configuration on existing rules.
The text was updated successfully, but these errors were encountered: