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

Feat/rule fs #665

Merged
merged 3 commits into from
Oct 8, 2019
Merged

Feat/rule fs #665

merged 3 commits into from
Oct 8, 2019

Conversation

chunksnbits
Copy link
Contributor

@chunksnbits chunksnbits commented Sep 28, 2019

resolves #650

First draft for rule argument extension:

  • allows loading custom rules from local fs

I will await your feedback and update the implementation if needed.
Afterwards I can update the docs.

Note:
There seems to be an issue with the @types/react-router-dom dependency that caused the ui-package not not to build after first checkout.

I fixated the version at 4.3.5 and included the change in the PR (I believe I need it to pass CI), but would be happy to remove that change, if you prefer.

Copy link
Owner

@kamilkisiela kamilkisiela left a comment

Choose a reason for hiding this comment

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

Thank you :)


import {renderChange, Renderer, ConsoleRenderer} from '../render';

function hasBreaking(changes: Change[]): boolean {
return changes.some(c => c.criticality.level === CriticalityLevel.Breaking);
}

function resolveRule(name: string): Rule | undefined {
const filepath = isAbsolute(name) ? name : join(process.cwd(), name);
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
const filepath = isAbsolute(name) ? name : join(process.cwd(), name);
const filepath = ensureAbsolute(name);

@kamilkisiela kamilkisiela merged commit 386c904 into kamilkisiela:master Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow custom rules from file
2 participants