Skip to content

Commit

Permalink
change rule
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasAtSAP committed Aug 24, 2023
1 parent c588690 commit 63a8906
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/etc/create-review.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Generally, for each spelling mistake there are 2 ways to fix it:
`

const getInvalidUrlText = (text, link) => {
const updatedLink = (link.includes('localhost') ? 'http' : 'https') + '://' + link.split('/').slice(1).join('/')
const updatedLink = link.replace('http', 'https')

return createSuggestionText(`${text}(${updatedLink})`) + 'Please use wellformed URLs.'
}
Expand Down Expand Up @@ -141,10 +141,10 @@ module.exports = async ({ github, require, exec, core }) => {
// [only-wellformed-urls: URLs should be wellformed] -> only-wellformed-urls
const ruleName = details.split(':')[0].slice(1)

if (ruleName === 'only-wellformed-urls') {
if (ruleName === 'prefer-https-links') {
const [, text, link] = context.match(/\[Context:.*(\[.*\])(\(.*\)).*\]/)

description = 'Only use wellformed URLs'
description = 'https links should be prefered'
contextText = `[Context: "${escapeMarkdownlink(text + link)}"]`

const { line, position } = await findPositionInDiff(text + link, path)
Expand Down
6 changes: 3 additions & 3 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ code-fence-style:
no-empty-links: true
search-replace:
rules:
- name: only-wellformed-urls
message: URLs should be wellformed
searchPattern: /\[.*?\]\((?!(https:\/\/|http://localhost|#)).+?\)/g
- name: prefer-https-links
message: https links should be prefered
searchPattern: /http:\/\/(?!localhost).*/g

0 comments on commit 63a8906

Please sign in to comment.