mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 16:14:21 +02:00
[CTOR-179] Include orthograph/syntax checks in CI for MC documentation (#4788)
Co-authored-by: Sophie Depassio <sdepassio@centreon.com>
This commit is contained in:
parent
40b0b49f04
commit
ce2d46160d
22
.github/scripts/pod_spell_check.t
vendored
Normal file
22
.github/scripts/pod_spell_check.t
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
use Test::Spelling;
|
||||||
|
|
||||||
|
if (!@ARGV) {
|
||||||
|
die "Missing perl file to check.";
|
||||||
|
}
|
||||||
|
|
||||||
|
my $stopword_filename='.github/scripts/stopwords.t';
|
||||||
|
if(defined($ARGV[1])){
|
||||||
|
$stopword_filename=$ARGV[1];
|
||||||
|
}
|
||||||
|
open(FILE, "<", $stopword_filename)
|
||||||
|
or die "Could not open $stopword_filename";
|
||||||
|
printf("stopword file use : ".$stopword_filename." \n");
|
||||||
|
|
||||||
|
add_stopwords(<FILE>);
|
||||||
|
set_spell_cmd('hunspell -l');
|
||||||
|
all_pod_files_spelling_ok($ARGV[0]);
|
||||||
|
close(FILE);
|
5
.github/scripts/stopwords.t
vendored
Normal file
5
.github/scripts/stopwords.t
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
--force-counters32
|
||||||
|
OID
|
||||||
|
oneaccess-sys-mib
|
||||||
|
SNMP
|
||||||
|
SSH
|
54
.github/workflows/spellchecker.yml
vendored
Normal file
54
.github/workflows/spellchecker.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
name: spell-checker
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/spellchecker.yml'
|
||||||
|
- 'src/**'
|
||||||
|
- '.github/scripts/pod_spell_check.t'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pod-spell-check:
|
||||||
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'do-not-spell-check') }}
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
|
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
base: ${{ github.ref }}
|
||||||
|
list-files: shell
|
||||||
|
filters: |
|
||||||
|
plugins:
|
||||||
|
- added|modified: src/**
|
||||||
|
|
||||||
|
- name: Install CPAN Libraries
|
||||||
|
uses: shogo82148/actions-setup-perl@ea0507898383e7dbce382138da0c21af1849eb9e # v1.27.0
|
||||||
|
with:
|
||||||
|
perl-version: '5.34'
|
||||||
|
install-modules-with: cpm
|
||||||
|
install-modules: Test::More Test::Spelling
|
||||||
|
|
||||||
|
- name: Install librairies
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y hunspell
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Run spell check
|
||||||
|
id: run_check
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
for f in ${{ steps.filter.outputs.plugins_files }}; do
|
||||||
|
echo "perl .github/scripts/pod_spell_check.t $f"
|
||||||
|
output=$(perl .github/scripts/pod_spell_check.t $f)
|
||||||
|
done
|
||||||
|
shell: bash
|
Loading…
x
Reference in New Issue
Block a user