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

Expand readme check #198

Closed
1 task done
swissspidy opened this issue Jun 21, 2023 · 7 comments
Closed
1 task done

Expand readme check #198

swissspidy opened this issue Jun 21, 2023 · 7 comments
Labels
[Type] Enhancement A suggestion for improvement of an existing feature

Comments

@swissspidy
Copy link
Member

Is your enhancement related to a problem? Please describe.

Follow-up to #178

The current check is rather simple, but there are many more things that can be checked. I actually wrote a CLI command for that last year, which should be pretty easy to port over: https://github.com/swissspidy/validate-readme-command

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@swissspidy swissspidy added the [Type] Enhancement A suggestion for improvement of an existing feature label Jun 21, 2023
@ernilambar
Copy link
Member

While working on #392 I found few issues in the library. Parser is working as expected for the display of the file content. But in our case we need raw value which the class is not providing.

Example: Parser given trimmed version (150 characters) of short description. So we cannot check if actual short description is longer than 150 characters.

Another case, only 5 tags (sliced version) are returned. So it is not possible to warn if readme has more than 5 tags.

This limits our ability to expand more detailed readme check.

@swissspidy
Copy link
Member Author

Oh that is a good point. I see a few possible ways to address this:

  1. Submit changes upstream to the meta parser to allow retrieving raw values
  2. Use composer patches to add this only in this repo
  3. Fork the code
@ernilambar
Copy link
Member

@swissspidy I have created issue here in the repo afragen/wordpress-plugin-readme-parser#2 Any other data to be returned which we can use in our plugin?

@swissspidy
Copy link
Member Author

Note that https://github.com/afragen/wordpress-plugin-readme-parser is just a copy of https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php

So if we want to expand the parser (option 1), the ticket/PR would need to be created on Meta Trac.

But before we do any of that we first need to decide which option to actually take

@dd32
Copy link
Member

dd32 commented Jan 18, 2024

Another case, only 5 tags (sliced version) are returned. So it is not possible to warn if readme has more than 5 tags.

Some things trigger a "warning" in the readme parser which can be used to detect such things, for example:
https://github.com/WordPress/wordpress.org/blob/1cb4236b813ba7c296d7a4f986352996879432f9/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php#L637

Unfortunately too-many-tags is not one of them, nor is short-description-too-long.

I don't think it's worth adding a way to get the original content from the readme to that parser, but adding additional warnings there for cases you'd like to catch seems worthwhile to me.

For example; here's a quick PR I mocked up; dd32/wordpress.org@trunk...plugins/plugin-check-198
If you create a meta.trac ticket I'll submit it as a PR example that you can build off or request additional flags.

@ernilambar
Copy link
Member

@ernilambar
Copy link
Member

Following readme related issues and PRs are open and under review.

After these issues are resolved, we could mark this issue as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement of an existing feature
3 participants