Skip to content

Commit

Permalink
proselint: trim the markdowns before running proselint
Browse files Browse the repository at this point in the history
Since the quoted parts generate too many false positives
  • Loading branch information
bagder committed Dec 20, 2024
1 parent 32561da commit e5af662
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/scripts/cleanmd.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <[email protected]>, et al.
#
# SPDX-License-Identifier: curl
#
# Input: a markdown file, it gets modified *in place*
#
# The main purpose is to strip off quotes, lines starting with four spaces,
# so that the result can be run through proselint better.
#

my $f = $ARGV[0];

open(F, "<$f") or die;

while(<F>) {
$_ =~ s/^ .*//g;

push @out, $_;
}
close(F);

open(O, ">$f") or die;
print O @out;
close(O);
3 changes: 3 additions & 0 deletions .github/workflows/proselint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: install prereqs
run: sudo apt-get install python3-proselint

- name: trim off quoted parts
run: find docs -name "*.md" -print0 | xargs -0 -n1 .github/scripts/cleanmd.pl

# config file help: https://github.com/amperser/proselint/
- name: store proselint config
run: |
Expand Down

0 comments on commit e5af662

Please sign in to comment.