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

[Bug] .github/ISSUE_TEMPLATE/feature_request.md can't use brackets (such as title: "[Improve]") without Remark-lint errors, don't know what to do. #23

Closed
4 tasks done
SwuduSusuwu opened this issue Feb 6, 2025 · 13 comments
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on

Comments

@SwuduSusuwu
Copy link

Initial checklist

Affected package

GitHub's workflow (https://github.com/<user>/<repo>/blob/<branch>/.github/workflows/codacy.yml

Steps to reproduce

Actual behavior

https://github.com/SwuduSusuwu/SubStack/security/code-scanning/2332

.github/ISSUE_TEMPLATE/feature_request.md:4

name: Feature request
about: Suggest an idea for this project
title: "[Improve] <relative path>: <what to do>"

[no-undefined-references] Found reference to undefined definition
Remark-lint (reported by Codacy)

Expected behavior

SwuduSusuwu/SubStack@719afd5 passes

Runtime

GitHub

Package manager

GitHub

Operating system

GitHub

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Feb 6, 2025
@SwuduSusuwu
Copy link
Author

If you escape those, Remark-lint shows "fixed", but now GitHub's YAML parser broke:

Error in user YAML: (<unknown>): found unknown escape character while parsing a quoted scalar at line 3 column 8


name: Feature request
about: Suggest how to improve code/workflow
title: "\[Improve\] <relative path>: <what to do>"

https://github.com/SwuduSusuwu/SubStack/issues/templates/edit suggests to have the title default to a bracketed prefix (such as [Bug]), so know GitHub allows this.
Other than disable Remark-lint, don't know what to do.

@SwuduSusuwu
Copy link
Author

With <!--lint ignore-->, remark_lint is fixed, but GitHub's YAML is broken;

Error in user YAML: (<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1


name: Feature request
about: Suggest how to improve code/workflow
<!--lint ignore-->
title: "[Improve] <relative path>: <what to do>"

From this message, guess is that GitHub uses static line numbers for those fields (rather than scan for those). If so, the solution is to not alter the line count, but all possible permutations of <!--...--> (such as at start or end of exigent lines) failed (that is what the long list of Update feature_request.md's followed by red boxes is).

@SwuduSusuwu
Copy link
Author

Related posts (both had to use remark-frontmatter to solve) show errors without brackets (which GitHub does not), so know GitHub has some form of remark-frontmatter now:

@SwuduSusuwu SwuduSusuwu changed the title .github/ISSUE_TEMPLATE/feature_request.md can't use brackets (such as title: "[Improve]") without Remark-lint errors, don''t know what to do. [Bug] .github/ISSUE_TEMPLATE/feature_request.md can't use brackets (such as title: "[Improve]") without Remark-lint errors, don't know what to do. Feb 6, 2025
@ChristianMurphy
Copy link
Member

Duplicate of remarkjs/remark-lint#324 and remarkjs/remark-message-control#11
The answer continues to be your lint platform codecy needs to enable remark frontmatter rtfpessoa/codacy-remark-lint#3

This comment has been minimized.

Copy link

github-actions bot commented Feb 6, 2025

Hi! Thanks for taking the time to contribute!

Because we treat issues as our backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn’t an exact duplicate but is closely related.

Thanks,
— bb

Copy link

github-actions bot commented Feb 6, 2025

Hi team! It seems this post is a duplicate, but hasn’t been marked as such. Please post a comment w/ Duplicate of #123(no final .) to do so. See GH docs for more info.

Thanks,
— bb

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Feb 6, 2025
@ChristianMurphy
Copy link
Member

You could also chose to not use Codecy, if they won't enable remark-frontmatter, and call remark cli + remark lint + remark frontmatter from your project directly

@SwuduSusuwu
Copy link
Author

SwuduSusuwu commented Feb 6, 2025

Duplicate of remarkjs/remark-lint#324 and remarkjs/remark-message-control#11 The answer continues to be your lint platform codecy needs to enable remark frontmatter rtfpessoa/codacy-remark-lint#3

This is not a duplicate.

  • Those were closed because this is a remark-frontmatter issue, so posted this to remarkjs/remark-frontmatter.
  • The GitHub tools do use remark-frontmatter, which is the reason that the error is not triggered on all .github/ISSUE_TEMPLATES/*.md (just on those which use brackets).
  • The error which occurs if remark-frontmatter is not enabled is different from this [no-undefined-references] Found reference to undefined definition

@SwuduSusuwu
Copy link
Author

SwuduSusuwu commented Feb 6, 2025

https://github.com/codacy/codacy-remark-lint/blob/master/package.json#L68=L75 shows "dependencies": { ... "remark-frontmatter": "^3.0.0",; know that is for frontmatter use.

@ChristianMurphy
Copy link
Member

know that is for frontmatter use.

Having it as a dependency doesn't mean it is used or configured.
This is not a frontmatter bug.
We validate issue templates too, and do not have this issue.

@SwuduSusuwu
Copy link
Author

SwuduSusuwu commented Feb 7, 2025

know that is for frontmatter use.

Having it as a dependency doesn't mean it is used or configured. This is not a frontmatter bug.

The sole configuration file is - https://github.com/<user>/<repo>/blob/<branch>/.github/workflows/codacy.yml does not seem to have an option for this., which does not have an option to enable or disable remark-frontmatter. Thus the fact that remark-frontmatter is included (coupled with the lack of errors which the lack of remark-frontmatter causes (such as errors about the 3 dashes at the top)) shows that remark-frontmatter is used.

We validate issue templates too, and do not have this issue.

But your templates don't include brackets (such as [Bug] `build.sh` without params....
Without brackets, do not have this issue.
The reason for those brackets is: without brackets around the first word (such as Bug `build.sh` without params..., the grammar implies that the first word forms a command as part of the sentence (as opposed to the category of the post).

@wooorm
Copy link
Member

wooorm commented Feb 7, 2025

You have problems with codacy: go talk to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

3 participants