i3/travis/check-spelling.pl
Michael Stapelberg ef8935b1db
autotools: place binaries in top level of build dir, not in subdirs (#4093)
meson only supports the top level (no subdirs), so this makes the transition
easier.

For this to work with autotools, we need to *disable* the subdir-objects option,
that autotools wants us to enable for forward-compatibility.

This results in a bunch of warnings at autoreconf-time, but we don’t care, given
that we intend to switch away from autotools. Both build systems working next to
each other (as best as they can) is more important.

related to #4086
2020-05-18 22:18:00 +02:00

68 lines
1.8 KiB
Perl
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env perl
# vim:ts=4:sw=4:expandtab
#
# © 2016 Michael Stapelberg
#
# Checks for spelling errors in binaries and manpages (to be run by continuous
# integration to point out spelling errors before accepting contributions).
use strict;
use warnings;
use v5.10;
use autodie;
use lib 'testcases/lib';
use i3test::Util qw(slurp);
use Lintian::Spelling qw(check_spelling);
# Lintian complains if we dont set a vendor.
use Lintian::Data;
use Lintian::Profile;
my $profile = Lintian::Profile->new;
$profile->load('debian', ['/usr/share/lintian']);
Lintian::Data->set_vendor($profile);
my $exitcode = 0;
# Whitelist for spelling errors in manpages, in case the spell checker has
# false-positives.
my $binary_spelling_exceptions = {
#'exmaple' => 1, # Example for how to add entries to this whitelist.
'betwen' => 1, # asan_flags.inc contains this spelling error.
};
my @binaries = qw(
build/i3
build/i3-config-wizard
build/i3-dump-log
build/i3-input
build/i3-msg
build/i3-nagbar
build/i3bar
);
for my $binary (@binaries) {
check_spelling(slurp($binary), $binary_spelling_exceptions, sub {
my ($current, $fixed) = @_;
say STDERR qq|Binary "$binary" contains a spelling error: "$current" should be "$fixed"|;
$exitcode = 1;
});
}
# Whitelist for spelling errors in manpages, in case the spell checker has
# false-positives.
my $manpage_spelling_exceptions = {
};
for my $name (glob('build/man/*.1')) {
for my $line (split(/\n/, slurp($name))) {
next if $line =~ /^\.\\\"/o;
check_spelling($line, $manpage_spelling_exceptions, sub {
my ($current, $fixed) = @_;
say STDERR qq|Manpage "$name" contains a spelling error: "$current" should be "$fixed"|;
$exitcode = 1;
});
}
}
exit $exitcode;