-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix markdown output of remark and run remark over existing content #3310
Comments
Will do. |
Are we currently using the |
You can just edit the settings in codacy, I think. |
remarkjs/codacy has started to become a pain due to presets being broken. From my investigation it seems that the overrides of the For example, when I added a different line length limit of 40 to the news subconfig, codacy would start to randomly report 40 on some lines and 80 on others (80 being the limit from the preset itself). Locally where I installed rules with I can't and aggressively don't want to try to see if I can go and fix remarkjs, so instead I had a go at setting up markdownlint + github actions on a fork (not without accidentally screwing up and opening a PR to upstream instead of my own fork, gotta love it). I got it to a point where it's working - as can be seen here - but the workflow definition is... somewhat arcane and not as maintainable perhaps? The UX is kind of a downgrade too - a plain text list of lines and errors is less friendly than codacy's nice file view. The possible upside to actions is however that I might just be able to get markdownlint-cli's (Oh, and another nice (?) thing is that due to workflows being built in everyone will automatically get CI on their own forks.) Future goals if I continue with this:
|
is the issue only with the news config? |
It's not, it also happens with wiki articles (example - see 80 char warnings in there). As far as I can tell (which is not far as codacy is a black box) it's the same as when I wrongly globally installed remark and its linter rules, and the actual issue boils down to the base preset not being affected by the overrides that come after it. As a side note I also have a working github actions setup with a proper remark installation and I'm leaning towards that instead as the output is a little bit nicer. Auto-fixes are a no-go unfortunately due to implementation foibles (workflows running on PRs from forks have read-only perms to avoid leaking secrets). |
Seems like a feasible solution. Have you looked into getting inline output? I've seen other workflows which can add the errors inline in the source to make it easier to understand. |
From what I've seen so far remark will print the files analysed to stdout, but unfortunately it seems not in the way that would be useful here (just spews file contents first and then the linter warnings). I'll poke around some more to see if having that is achievable. |
bdach's ci is working well enough to drop codacy @peppy , codacy's just causing confusion with newer contributors new todos, i'd say only the first two are important for now:
|
the checking-for-new-errors is going to require use of github actions assets, i think (maybe we should be publishing the analysis results for each master build and then diffing). i'll turn off codacy now |
I think I can make the remarkjs plugins for everyone, I also suggest we not only limit ourselves in the confines of GitHub, but also take this linting prowess to contributor's desktop so they catch the problem early on before publishing. |
that's how it's been already, |
For reporting only new errors it seems remark has a thing called vfile - if we persisted that (just the messages, presumably) then we could exclude the pre-existing errors. It's probably easier said than done though. I'm willing to help with development of custom tools for this, even though it's js. |
Starting out development of this in a repo, will disclose details in a few. |
Going to extend more of the original PR with local linting powers ( #3533 ). It seems its a very bad idea to run remark on |
news should be handled with a local config override as codacy was setup to do, if possible. |
Let me see what I can do in the Remark side. |
it looks like the answer's gonna be no to the first part, so here's more looking into stringify after #3775
should be pretty close to done after that. |
I found a VS Code extension that integrates with |
skimmed through the issue, and it seems that it can be closed (especially because we can run the check now locally). also, I have an impression that most of the style issues with existing articles were fixed when the articles were touched (in order to get them merged). |
re-opening this one to track the status of remark-stringify matching as best as possible with remark-lint, I don't think that was ever finished... |
2022 edit(by clayton): this issue was originally tracking something more like #2275, but is now tracking the status of remark-stringify producing correct output for osu-wiki. see my comments in this thread but leads on improving it, but they may be outdated. use #2275 to track any existing formatting issues or wanted CI checks.
There have been recent PRs attempting to fix markdown inconsistencies, mixed in with other manual changes that ends up being an absolute mess to review and just isn't how commits should be done.
I've added codacy which uses remarkjs for linting. It seems like a good starting point.
Next steps would be for contributors to check through the reported issues and help tweak the inspections / configuration file to match our expectation. For instance, we will need to disable the naked URL rule or see if we can train it to ignore the header content.
Once a configuration is decided on, it should be run on all articles in a single commit, then enforced via CI on pull requests (already enabled but not required for merging just yet).
The text was updated successfully, but these errors were encountered: