Add support for checking operators at end-of-line
[style_checker.git] / gps / style_checker.xml
blob5704b5cfbf4cfa553f8f91281fba292ab4b3fb50
1 <?xml version="1.0" ?>
2 <!--  This file adds support for the style_checker utility to GPS. -->
4 <style_checker>
5    <action name="Style_Checker" output="none" category="Style_Checker">
6       <description>Check source code style.</description>
8       <shell>MDI.save_all</shell>
9       <shell>Locations.remove_category "Style Checker"</shell>
10 <!--      <shell>Project %p</shell> -->
11 <!-- Use the above to have a per-project configuration -->
12       <shell>Project.root</shell>
13       <shell>Project.get_tool_switches_as_string %1 Style_Checker</shell>
14       <external output="">style_checker %1 "%F"</external>
15       <on-failure>
16         <shell>Locations.parse "%1 " "Style Checker"</shell>
17       </on-failure>
18    </action>
20    <submenu>
21       <Title>Edit</Title>
22       <menu action="Style_Checker" before="Unit Testing" >
23          <title>Check for style errors</title>
24       </menu>
25    </submenu>
27    <tool name="Style_Checker" package="Style_Checker" index="Style_Checker" >
28       <language>Ada</language>
29       <switches lines="3">
30          <title line="1" >Simple switches</title>
31          <title line="2" >Line ending</title>
32          <title line="3" >Copyright</title>
34          <!-- section 1 -->
35          <check label="Allow trailing spaces"
36                 switch="-T" line="1"/>
38          <check label="Allow duplicate blank lines"
39                 switch="-B" line="1"/>
41          <check label="Allow single space after comment characters"
42                 switch="-C" line="1"/>
44          <check label="Forbid single comment line ending with dot"
45                 switch="-d" line="1"/>
47          <check label="Disable Ada syntax check"
48                 switch="-S" line="1"/>
50          <spin label="Maximum line length" min="50" max="120" default="79"
51                switch="-l"/>
53          <check label="Do not check for header size"
54                 switch="-H" line="1"/>
56          <spin label="Header size" min="0" max="40" default="20"
57                switch="-h"/>
59          <dependency master-page="Style_Checker" slave-page="Style_Checker"
60                      master-switch="-H"
61                      slave-switch="-h"
62                      master-status="on" slave-status="20" />
64          <dependency master-page="Style_Checker" slave-page="Style_Checker"
65                      master-switch="-h"
66                      slave-switch="-H"
67                      master-status="21" slave-status="off" />
69          <dependency master-page="Style_Checker" slave-page="Style_Checker"
70                      master-switch="-h"
71                      slave-switch="-H"
72                      master-status="19" slave-status="off" />
74          <!-- section 2 -->
75          <radio line="2">
76            <radio-entry label="Do not check line ending" switch="-E" />
77            <radio-entry label="DOS line ending" switch="-eDOS" />
78            <radio-entry label="UNIX line ending" switch="-eUNIX" />
79          </radio>
81          <!-- section 3 -->
82          <check label="Check for copyright presence"
83                 switch="-cp" line="3"/>
85          <check label="Check for copyright year"
86                 switch="-cy" line="3"/>
88          <field label="Copyright pattern" switch="-cf"
89                 separator=" " line="3"/>
90       </switches>
91    </tool>
92 </style_checker>