File: Coding_Style_Checker.md

package info (click to toggle)
mpich 4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 101,184 kB
  • sloc: ansic: 1,040,629; cpp: 82,270; javascript: 40,763; perl: 27,933; python: 16,041; sh: 14,676; xml: 14,418; f90: 12,916; makefile: 9,270; fortran: 8,046; java: 4,635; asm: 324; ruby: 103; awk: 27; lisp: 19; php: 8; sed: 4
file content (65 lines) | stat: -rw-r--r-- 2,704 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## Coding Style Checker

(This page is mostly a stub)

The coding style checker used by the MPICH2 project is a simple yet
general purpose Perl program that applies a set of rules to all source
files in a directory tree.

The style checker is run every night by the script
`/home/MPI/nightly/updatetodo`. The command that is used is

```
  /home/gropp/projects/software/buildsys/src/codingcheck -conf=mpich2 \
         -skipfiles=src/mpid/globus,src/mpe2,src/pm/smpd,src/pm/ompd,src/pm/forker,src/mpid/mm,src/mpid/rdma,src/pm/mpd/examples,src/mpid/ch3/channels/rdma,src/mpid/dcmfd \
        -checktest src examples test
```

The options have the following meanings:

  - \-conf=mpich2: Apply the rules in `mpich2.pl` configuration file.
    This is located in the the `share/lib/coding` directory of the
    buildsys project (currently in
    `/home/gropp/projects/software/buildsys`). The contents of this are
    described below.
    \-skipfiles=list: Skip the files in the list. If the "file" is a
    directory, skip the directory and all of its members. This is used
    to skip directories from other projects that have their own (we
    hope) style guidelines and directories that are deprecated but still
    present in the source tree.
    \-checktest: Apply the style checks to files in directories with a
    parent directory of test. This applies the style checks to the
    MPICH2 test programs.
    src examples test:The remaining arguments are the files or
    directories to check.j

### The mpich2.pl configuration file

The `mpich2.pl` configuration file defines the tests to be applied to
the files in the MPICH2 project. In addition to some common tests, this
defines MPICH2-specific tests. These include:

  -
    CheckForPMPI: Check for the use of PMPI routines instead of NMPI.
    Allow the use of PMPI in certain files (by testing on the filename).

The default tests include

  - cppdefines: Check for proper use of the C preprocessor, including
    standard directives and name format
    comments: Check for valid comments (e.g., avoid // in C programs)
    and process special comments (see below)
    avoidfuncs: Check for functions whose use should normally be avoided
    (e.g., strcpy)
    funcnests: Check for possible problem is using the MPICH2 Nest_incr
    and decr
    notabs: Check that Fortran source files do not contain tabs.

While processing comments, the style checker looks for these special
forms:

  - copyright: Checks for the copyright
    preamble: Checks for the standard preamble (setting the Emacs
    language and indent amount)
    style: Checks for overrides for style checks, such as allowing the
    use of a function in the avoid-function list