summaryrefslogtreecommitdiffstats
path: root/util/check-format.pl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* check-format.pl: do checks regarding statement/block after for() also on ↵Dr. David von Oheimb2024-09-241-7/+7
| | | | | | | | {OSSL_,}LIST_FOREACH{,_*} Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> (Merged from https://github.com/openssl/openssl/pull/25535)
* Copyright year updatesTomas Mraz2024-09-051-1/+1
| | | | | Reviewed-by: Neil Horman <nhorman@openssl.org> Release: yes
* Modify check-format to match line length coding styleNeil Horman2024-07-111-8/+9
| | | | | | | | | | | | | | | | | | | | In an effort to clarify our coding style, generally line lengths SHOULD be no longer than 80 columns but MUST be no longer than 100 columns Modify the check-format.pl script to account for this. Replace the -l|--sloppy-len option (which modifies the max line length to 84 rather than 80 cols), with -l|--strict-len which reduces allowed line length to 80 cols from the new default 100 cols). Also fix up a typo in the docs indicating --sloppy-bodylen has a short -l option (its actually -b) Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/24841)
* check_format.pl: fix detection of 'if' with single stmt in braces without 'else'Dr. David von Oheimb2024-07-081-4/+7
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24805)
* Copyright year updatesMatt Caswell2023-09-071-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
* check-format.pl: fix statistics on whitespace and nesting issuesDr. David von Oheimb2023-02-081-3/+3
| | | | | | Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19796)
* check-format.pl: fix detection of '#ifdef __cplusplus'Dr. David von Oheimb2023-02-081-1/+1
| | | | | | Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19796)
* check-format.pl: fix detection of function body startDr. David von Oheimb2023-02-081-3/+3
| | | | | | Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19796)
* check-format.pl: improve whitespace reporting on <op>=Dr. David von Oheimb2022-09-021-2/+8
| | | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18812)
* check-format.pl: further fixes for whitespace reporting within 'for (...)'Dr. David von Oheimb2022-09-021-5/+9
| | | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18812)
* check-format.pl: report #if and #elif with constant condition; improve ↵Dr. David von Oheimb2022-09-021-5/+5
| | | | | | | | | checks on '/*' Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18812)
* check-format.pl: extend checking into macro bodies; small further improvementsDr. David von Oheimb2022-09-021-59/+133
| | | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18812)
* check-format.pl: improve preprocessor directive handling; re-order state ↵Dr. David von Oheimb2022-09-021-44/+51
| | | | | | | | | variables Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18812)
* check-format.pl: fix detection of missing/extra blank lines in local declsDr. David von Oheimb2022-07-201-13/+15
| | | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18789)
* check-format.pl: fix false positive on 'for(;; stmt)'Dr. David von Oheimb2022-07-201-0/+1
| | | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18789)
* check-format.pl: improve wording: 'no' -> 'missing'; further minor improvementsDr. David von Oheimb2022-07-201-27/+28
| | | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18789)
* check-format.pl: Fix report on space before ';' and allow it after ')'Dr. David von Oheimb2022-01-091-1/+1
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17434)
* check-format.pl: Fix report on missing space before +/-: allow, e.g., '1e-6'Dr. David von Oheimb2022-01-091-2/+2
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17434)
* check-format.pl: Fix report on constant on LHS of comparison/assignmentDr. David von Oheimb2022-01-091-1/+2
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17434)
* check_format.pl: Add checks for blank lines within/after local declsDr. David von Oheimb2022-01-091-22/+49
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17434)
* Fix typosDimitris Apostolou2022-01-051-4/+4
| | | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17392)
* check-format.pl: Fix report on constant on LHS of comparison or assignmentDr. David von Oheimb2022-01-041-1/+1
| | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17396)
* always use the same perl in $PATHa13460542021-09-021-1/+1
| | | | | | | | | | | | | | | Different tests may use unexpectedly different versions of perl, depending on whether they hardcode the path to the perl executable or if they resolve the path from the environment. This fixes it so that the same perl is always used. Fix some trailing whitespace and spelling mistakes as well. CLA: trivial Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16362)
* check-format.pl: Rename '*-cmt' options '*-comment'Dr. David von Oheimb2021-05-201-22/+22
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15077)
* check-format.pl: Allow extra space before end-of-line comments unless ↵Dr. David von Oheimb2021-05-201-18/+22
| | | | | | | -e|--eol-cmt given Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15077)
* check-format.pl: Replace 'SPC' and 'spc' by 'space' in reports and option namesDr. David von Oheimb2021-05-201-37/+37
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15077)
* check-format.pl: Fix false positive on struct/union/enum in func return typeDr. David von Oheimb2021-05-201-4/+6
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15077)
* check-format.pl: Fix false positive "no SPC before binary '*'" for '!*'Dr. David von Oheimb2021-05-201-1/+1
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15077)
* check-format.pl: Report needless intermediate multiple SPC only on -e or ↵Dr. David von Oheimb2021-05-201-21/+27
| | | | | | | --extra-spc Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15077)
* check-format.pl: Add check for constant left of comparison operatorDr. David von Oheimb2021-05-201-1/+6
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15077)
* Update copyright yearRichard Levitte2021-01-281-1/+1
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13999)
* util/check-format.pl: Minor improvements of whitespace checksDr. David von Oheimb2021-01-191-6/+6
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13710)
* check-format.pl: Allow nested indentation of labels (not only at line pos 1)Dr. David von Oheimb2020-09-301-1/+1
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13019)
* check-format.pl: Extend exceptions for no SPC after trailing ';' in 'for (...;)'Dr. David von Oheimb2020-09-301-1/+2
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13019)
* check-format.pl: Document how to run positive and negative self-testsDr. David von Oheimb2020-09-301-0/+4
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13019)
* check-format.pl: Report empty lines only if -s (--sloppy-spc) is not usedDr. David von Oheimb2020-07-201-3/+3
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
* check-format.pl: Add check for essentially empty line at beginning of fileDr. David von Oheimb2020-07-201-1/+3
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
* check-format.pl: Add check for multiples essentially empty lines in a rowDr. David von Oheimb2020-07-201-1/+5
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
* check-format.pl: Allow comment start '/*' after opening '(','[','{'Dr. David von Oheimb2020-07-201-7/+9
| | | | | | | On this occasion fix uses of the word 'nor'. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
* fix false positive of check-format.pl regarding '#if' on preceding line; ↵Dr. David von Oheimb2020-03-181-1/+1
| | | | | | | | extend negative tests Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11285)
* make util/check-format.pl script executableDr. David von Oheimb2020-03-181-0/+0
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11285)
* fix false positive of check-format.pl reporting '{1 stmt}' after multi-line ↵Dr. David von Oheimb2020-03-181-1/+2
| | | | | | | | 'if(expr)' Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11285)
* Renew and extend the tool for checking adherence to C coding style rulesDr. David von Oheimb2020-03-091-0/+1118
aims at checking most of https://www.openssl.org/policies/codingstyle.html and various requirements not yet explicitly stated there - see also #10725 add util/check-format.pl and its self-tests in util/check-format-test-{positives,negatives}.c remove util/openssl-format-source Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/10363)