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

Use multiple markdownlint.yaml /versions and /schemas #115

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Bellangelo
Copy link
Member

@Bellangelo Bellangelo commented Jan 1, 2025

Closes: #104

Here it was decided to use different markdownlint.yaml files for /schemas and /versions since they have different purposes and as such, different standards.

What this PR introduces:

  1. A markdownlint.yaml exist in each folder, /versions and /schemas. Sub-folder linting seems to be supported by most plugins. See Differentiated config based on path DavidAnson/vscode-markdownlint#280
  2. format-markdown.sh requires now a --config parameter since now the config is not in a single place.
  3. Renamed and grouped our scripts in the package.json to use the same namespaces.

Comment on lines +11 to +14
MD024: false # duplicate headings
MD032: false # blanks-around-lists Lists should be surrounded by blank lines
MD033: false # inline HTML
MD047: false # single-trailing-newline Files should end with a single newline character
Copy link
Member Author

Choose a reason for hiding this comment

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

Rules 32 and 47 are disabled because they didn't pass. We can enable them again and format the file if that is what we desire.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please use the same rules for all *.md files and change the files that don't follow the rules yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I agree that the same rules apply for specification documents and our internal project documentation in markdown files. I think we already rejected a pull request that applied the same standards to both - We need to be strict and careful with the documents that are published, I'm not sure the same applies if people are adding different content types.

Copy link
Member Author

Choose a reason for hiding this comment

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

HI @ralfhandl , I am not against in what you are proposing but @lornajane is right about the rejected PR. Please check #105

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that the commented-out rules are trivial to observe, I'd use the same rules.

The more interesting case will be when we make the rules for new spec documents stricter and will need different rule sets for files in the versions folder, as we already do for OAS.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ralfhandl Ok. But what this means for the other comments that you made? Such as #115 (comment)

To be more precise, are we keeping the multiple lint configs or are we using a single one?

Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer keeping a single rule file and adjusting all Markdown files across all folders accordingly.

@ralfhandl
Copy link
Contributor

it was decided to use different markdownlint.yaml files for /schemas and /versions

Actually we'd like to apply the same rules to all Markdown files in this repository, including the ones in the repository root.

Comment on lines +11 to +14
MD024: false # duplicate headings
MD032: false # blanks-around-lists Lists should be surrounded by blank lines
MD033: false # inline HTML
MD047: false # single-trailing-newline Files should end with a single newline character
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please use the same rules for all *.md files and change the files that don't follow the rules yet.

Comment on lines +5 to +26
CONFIG=""

while [[ $# -gt 0 ]]; do
case $1 in
--config)
CONFIG="$2"
shift # Remove --config from processing
shift # Remove the value from processing
;;
*)
FILES+="$1 "
shift # Move to the next argument
;;
esac
done

if [ -z "$CONFIG" ]; then
echo "Error: --config parameter is required."
exit 1
fi

for filename in $FILES; do
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessary, same rules for all files

Copy link
Contributor

Choose a reason for hiding this comment

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

Please move back to root folder

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.

Consider markdown lint on all .md files (spec, schema readme)
3 participants