-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
84 lines (57 loc) · 2.67 KB
/
README
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
style per partes
stylepp is a tool to maintain a consistent style.
It consists of independent programs which can be used as needed.
You need to run:
make
to compile stylepp. Then you can add the stylepp/script directory
into your PATH or run them with relative names.
For simplicity stylepp works on git repositories. For different version
control system use git-svn/git-cvs/'insert bridge'.
A two basic workflows are possible.
First run an initial cleanup over codebase; this separates formatting changes
from code changes.
Then to maintain a consistent state you need either add the appropriate hook
or run formatter periodically. A hook version is run by --hook argument.
You need to specify which files are stylepp's responsibility.
A best way so far is write a script named ignore that does:
git checkout HEAD blacklisted files # Link to upstream project.
This simplifies splitting and sending every format patch; not just
stylepp ones.
There are several areas that stylepp covers:
spellchecking:
We try to make our commands safe. A spellchecker touches
in source files will touch only comments.
You can use following commands:
stylepp_spell_patch:
A high level script that automates most parts of generating patch that
fixes typos. For other workflows we recommend to copy and modify this script.
stylepp_strip_diff:
When verifying that patch fixes typos most of time is spend on finding what
was changed. A stylepp_strip_diff is a tool that takes patch as input and
present it in compact form which is much easier to review.
stylepp_fix_spell:
A script that reads dictionary file (see maintained/dictionary_wiki)
Then it replaces occurrences of specified typos in comments.
stylepp_spellcheck:
A script that creates list of likely misspells from codebase. A
likely misspell is word that
1. Is present in comment.
2. Is not present in code.
3. Is wrong according to aspell.
4. Is lowercase.
stylepp_dictionary:
A script that takes list of misspells from stylepp_spellcheck and
with user help generates replacement dictionary.
warnings:
Check things that people should check. These are mostly used in hook.
stylepp_warn_dead_link:
Checks if all http links go to valid address.
stylepp_warn_copyright:
Print list of names that lack copyright header or header has wrong year.
refactoring:
stylepp_fix_executable_mode:
In large projects there are usualy few source files that are executable.
This script removes executable flag from them.
stylepp_long_line:
Finds which files have lines longer than 80 characters and opens vim
on them.