-
Notifications
You must be signed in to change notification settings - Fork 343
feat: linting pipeline to improve documentation quality #215
feat: linting pipeline to improve documentation quality #215
Conversation
If there is a general interest in this I can redo this PR to be more tidy. |
cf75073
to
2df3b5b
Compare
Dear @dreh23 , thank you very much for this demonstration. We very much like the idea of being able to:
in the markdown files. Would be amazing, if you could redo the PR to cover these use cases. Also, let us know what needs to be done from our side. CircleCI is being used in most of the projects, but Github Actions would work for us, as well. Thanks again! |
Just a small supplement: As described in the issue cwa-app-ios#149 there exists on fossies.org for all CWA sub-projects (repositories) a regularly updated misspelling report using the tool codespell. So e.g. (see #182) for the "cwa-documentation" project you may look at the URL By the way, some nice approaches and suggestions regarding the use of codespell via Github Actions you may find in the codespell issue #1499 and the corresponding actions-codespell repository. |
@jschleus I have a working npm setup for spellchecking utilizing mdspell. I did not include this here because I needed to research for multi language support (which should be easy). |
@dreh23 Sounds good. A appropriate test object would be the new markdown file |
207fe9e
to
e5ad315
Compare
I rebased and force-pushed some commits for testing the CI. The PR now can:
There are some questions I will raise as comments inline. I would kindly ask for review, so I can fix outstanding issues. Once we are satisfied I can squash and tidy up commit message and/or branch name. Please see the CI in action: https://github.com/dreh23/cwa-documentation/runs/782141632?check_suite_focus=true PS: I included the spellchecker and this works great for single language files. Multilanguage is not supported right now, but this can be solved with different Makefile targets. This has some implications we would need to address:
The corresponding makefile targets are then:
|
ec1c220
to
2d86801
Compare
I rebased, added a trailing spaces detector which unfortunately does not work on github actions (but offline) and other small improvements. make detect-whitespaces |
50e0690
to
31eb503
Compare
I implemented #351 and bumped all npm packages. Additionally smaller corrections on language. |
31eb503
to
aee40e0
Compare
I've tried the makefile today, but to no avail. I guess this might have something to do with zsh being my SHELL on mac. As a suggestion, why not use the package.json to consolidate the scripts:
Unfortunately, the detect-whitespace did not work. |
Sure why not. However I am quite unfamiliar with npm test, how could I run a single test, so we have atomic return codes for the CI?. |
In the ci, we could also run the commands sequentially, e.g., then For grep I just get:
|
Could you try again removing the flag "-P" |
Now I'm running into issues with
|
aee40e0
to
0029197
Compare
I will remove the white space detection for now. We can have a follow up PR. I would rather like to get this merged, soon. |
Yes, makes sense. And thanks again for all your work on this! |
This Makefile provides several targets for linting documents. It utilizes several npm packages. Functionality includes: * Spellcheck * Linting of markdown * Check for broken links * Sorting of dictionary file * Detect inconsidered language All targets (excluding the sorting of the dict file) are part of the Github Action pipeline and will fail if quality standards are not met. Signed-off-by: Johannes Amorosa <johannes.amorosa@endocode.com>
0029197
to
ff34c16
Compare
Please review again. Latest CI run: https://github.com/dreh23/cwa-documentation/runs/826304712 |
Created a follow-up ticket #355 |
By the way, although in the meantime nearly superfluous there exists now on the Fossies server a regularly updated small page showing a summary of the (very few) still found codespell errors in the diverse CWA projects: https://fossies.org/linux/test/cwa_codespell_status.html @dreh23 If there is still an interest on the "detect-whitespaces" (maybe better named "detect-whitespaces-at-line-end" or similar) I want to made some small remarks to the above mentioned code line that makes some problems. Although I'm not very familiar with Makefiles and not familiar with JSON, I make only some general comments regarding the used basic command line. At a first glance I assume that the a little bit tricky command line probably should show all not excluded markdown files together with their number of lines that contain a space or a tab at the line end (achieved by "tee /dev/tty") and after that a line containing just the sum of all found such lines (onto the standard output).
Additionally, if the command And more enerally, if the file names may contain newlines or other So an improved basic version may be (nearly untested)
These are just a few hopefully correct comments, but I may also be completely wrong. |
@jschleus Thanks for your input! The fossies page is rather nice, one downside I see its an external service. The tee command doesn't work in the CI and the whole line is anyway ugly (Perl is calling from the last century) - we may have to see if there is a more elegant approach (with npm). Some of the complexity of the command was about the return value that has to be right (because of the CI). But I agree it had several flaws, because it was done hastily from my side. However the trailing space issue is now excluded from this PR. I will test your command line foo and then we can move the discussion to #355 . If there is no more objections/bug/design flaws I would kindly ask for a merge and we can pick up missing things from there. I believe this PR will drastically improve from the situation before. |
Hi @dreh23 , yes, I will merge this soon, ideally later today or during the weekend, depending on other tasks coming in (still have to go through the solution architecture changes....) But just as a heads up, I will then do some changes afterwards:
As you've already put so much effort in the PR (again, THANK YOU!!), I would just do these minor changes by myself, so you don't have to touch things again. |
Great! You're welcome. If you need me testing, please add me as a reviewer. |
Finally found the time this weekend to merge this PR. Thanks again for all your great work! I will take some time this week to go through the spelling and linting errors. But for starters, I already fixed a broken link to the Apple documentation 😄 |
This Makefile provides a target for linting markdown coded
documentation files with commonmark. It utilizes a npm
package. There are several targets like "check" which includes
subtasks: linting and dead link checking.
This PR is more a proposal for a proper documentation workflow.
We could add spellchecking and other checks and a CI context
to enforce good quality. This can also be done with github
actions of course.
Signed-off-by: Johannes Amorosa johannes.amorosa@endocode.com