Skip to content

Change link checker to warning-only#9219

Merged
aghassemi merged 3 commits intoampproject:masterfrom
rsimha:2017-05-08-NonBlockingLinkChecker
May 9, 2017
Merged

Change link checker to warning-only#9219
aghassemi merged 3 commits intoampproject:masterfrom
rsimha:2017-05-08-NonBlockingLinkChecker

Conversation

@rsimha
Copy link
Copy Markdown
Contributor

@rsimha rsimha commented May 9, 2017

This PR makes the link checker a warning-only tool that does not block PR merges. This is because some md files contain script tags that have links in them, and they are being detected as false negatives. If we figure out a way to ignore such links, we can consider making it PR blocking once again.

/to @dvoytenko @choumx

@rsimha rsimha requested a review from dvoytenko May 9, 2017 02:22
@rsimha rsimha self-assigned this May 9, 2017
@rsimha rsimha added this to the Sprint H1 May milestone May 9, 2017
@rsimha rsimha requested a review from dreamofabear May 9, 2017 14:25
util.log(
util.colors.red('ERROR'), 'Dead links found in',
util.colors.magenta(markdownFiles[index]), '(please update it).');
util.colors.yellow('WARNING'), 'Dead links potentially found in',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: "Possible dead link found in"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

util.colors.yellow('WARNING'),
'Dead links potentially found. Please update',
util.colors.magenta(filesWithDeadLinks.join(',')),
'if necessary.');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why have this warning message display twice? Looks like once for each file and once overall?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, this is for the case where many md files are edited in one PR, so all dead links can be detected in one go. Saves the trouble of having to re-test after every fix.

util.log(
util.colors.red('ERROR'), 'Dead links found in',
util.colors.magenta(markdownFiles[index]), '(please update it).');
util.colors.yellow('WARNING'), 'Possible dead link(s) found in',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry one more nit: each argument on its own line for consistency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@rsimha
Copy link
Copy Markdown
Contributor Author

rsimha commented May 9, 2017

@choumx, seems like I still don't have write access. Could you merge this please?

@aghassemi aghassemi merged commit c42c79a into ampproject:master May 9, 2017
@rsimha rsimha deleted the 2017-05-08-NonBlockingLinkChecker branch May 9, 2017 15:44
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