lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 Jun 2020 00:13:42 -0700
From:   Joe Perches <joe@...ches.com>
To:     SeongJae Park <sjpark@...zon.com>, akpm@...ux-foundation.org,
        apw@...onical.com
Cc:     colin.king@...onical.com, sj38.park@...il.com,
        linux-kernel@...r.kernel.org, SeongJae Park <sjpark@...zon.de>
Subject: Re: [PATCH v3 1/2] checkpatch: support deprecated terms checking

On Wed, 2020-06-10 at 08:52 +0200, SeongJae Park wrote:
> From: SeongJae Park <sjpark@...zon.de>
> 
> Some terms could be deprecated for various reasons, but it is hard to
> update the entire old usages.  That said, we could at least encourage
> new patches to use the suggested replacements.  This commit adds check
> of deprecated terms in the 'checkpatch.pl' for that.  The script will
> get deprecated terms and suggested replacements of those from
> 'scripts/deprecated_terms.txt' file and warn if the deprecated terms are
> used.  The mechanism and the format of the file are almost the same as
> that of 'spelling.txt'.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> +# Load deprecated terms and build regular expression list.
> +my $deprecated_terms;
> +my %deprecated_terms_fix;
> +
> +if (open(my $deprecates, '<', $deprecated_terms_file)) {
> +	while (<$deprecates>) {
> +		my $line = $_;
> +
> +		$line =~ s/\s*\n?$//g;
> +		$line =~ s/^\s*//g;
> +
> +		next if ($line =~ m/^\s*#/);
> +		next if ($line =~ m/^\s*$/);
> +
> +		my ($suspect, $fix) = split(/\|\|/, $line);
> +
> +		$deprecated_terms_fix{$suspect} = $fix;
> +	}
> +	close($deprecates);
> +} else {
> +	warn "No deprecated term will be found - file '$deprecated_terms_file': $!\n";
> +}
> +
> +$deprecated_terms = join("|", sort keys %deprecated_terms_fix) if keys %deprecated_terms_fix;
> +

This is a direct copy of the spelling dictionary
loading code, so maybe these could be consolidated.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ