Skip to content

Commit 313d9c7

Browse files
authored
Issue#1397: Added whitespace rules for file declarations (#1484)
* Issue#1397: Added rule file_101. * Issue#1397: Added tests for rule file_101. * Issue#1397: Added docs for rule file_101. * Issue#1397: Added whitespace rules for file_open_information. * Issue#1397: Added tests for whitespace rules for file_open_information. * Issue#1397: Added docs for whitespace rules for file_open_information. * Issue#1397: Updated test class names.
1 parent d87a3b1 commit 313d9c7

26 files changed

+606
-0
lines changed

docs/configuring_whitespace_rules.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,12 @@ Rules Enforcing Whitespace
188188
* `external_variable_name_102 <external_variable_name_rules.html#external-variable-name-102>`_
189189
* `external_variable_name_103 <external_variable_name_rules.html#external-variable-name-103>`_
190190
* `external_variable_name_104 <external_variable_name_rules.html#external-variable-name-104>`_
191+
* `file_open_information_100 <file_open_information_rules.html#file-open-information-100>`_
192+
* `file_open_information_101 <file_open_information_rules.html#file-open-information-101>`_
193+
* `file_open_information_102 <file_open_information_rules.html#file-open-information-102>`_
194+
* `file_open_information_103 <file_open_information_rules.html#file-open-information-103>`_
191195
* `file_100 <file_rules.html#file-100>`_
196+
* `file_101 <file_rules.html#file-101>`_
192197
* `function_100 <function_rules.html#function-100>`_
193198
* `function_101 <function_rules.html#function-101>`_
194199
* `generate_002 <generate_rules.html#generate-002>`_

docs/file_open_information_rules.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,90 @@
33
File Open Information Rules
44
---------------------------
55

6+
file_open_information_100
7+
#########################
8+
9+
|phase_2| |error| |whitespace|
10+
11+
This rule checks for a single space before the **open** keyword.
12+
13+
|configuring_whitespace_rules_link|
14+
15+
**Violation**
16+
17+
.. code-block:: vhdl
18+
19+
file defaultImage : load_file_type open read_mode is load_file_name;
20+
21+
**Fix**
22+
23+
.. code-block:: vhdl
24+
25+
file defaultImage : load_file_type open read_mode is load_file_name;
26+
27+
file_open_information_101
28+
#########################
29+
30+
|phase_2| |error| |whitespace|
31+
32+
This rule checks for a single space after the **open** keyword.
33+
34+
|configuring_whitespace_rules_link|
35+
36+
**Violation**
37+
38+
.. code-block:: vhdl
39+
40+
file defaultImage : load_file_type open read_mode is load_file_name;
41+
42+
**Fix**
43+
44+
.. code-block:: vhdl
45+
46+
file defaultImage : load_file_type open read_mode is load_file_name;
47+
48+
file_open_information_102
49+
#########################
50+
51+
|phase_2| |error| |whitespace|
52+
53+
This rule checks for a single space before the **is** keyword.
54+
55+
|configuring_whitespace_rules_link|
56+
57+
**Violation**
58+
59+
.. code-block:: vhdl
60+
61+
file defaultImage : load_file_type open read_mode is load_file_name;
62+
63+
**Fix**
64+
65+
.. code-block:: vhdl
66+
67+
file defaultImage : load_file_type open read_mode is load_file_name;
68+
69+
file_open_information_103
70+
#########################
71+
72+
|phase_2| |error| |whitespace|
73+
74+
This rule checks for a single space after the **is** keyword.
75+
76+
|configuring_whitespace_rules_link|
77+
78+
**Violation**
79+
80+
.. code-block:: vhdl
81+
82+
file defaultImage : load_file_type open read_mode is load_file_name;
83+
84+
**Fix**
85+
86+
.. code-block:: vhdl
87+
88+
file defaultImage : load_file_type open read_mode is load_file_name;
89+
690
file_open_information_500
791
#########################
892

docs/file_rules.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ This rule checks for a single space before the identifier.
9292
9393
**Fix**
9494

95+
.. code-block:: vhdl
96+
97+
file defaultImage : load_file_type open read_mode is load_file_name;
98+
99+
file_101
100+
########
101+
102+
|phase_2| |error| |whitespace|
103+
104+
This rule checks for a single space after the identifier.
105+
106+
|configuring_whitespace_rules_link|
107+
108+
**Violation**
109+
110+
.. code-block:: vhdl
111+
112+
file defaultImage : load_file_type open read_mode is load_file_name;
113+
114+
**Fix**
115+
95116
.. code-block:: vhdl
96117
97118
file defaultImage : load_file_type open read_mode is load_file_name;

docs/rule_groups/whitespace_rule_group.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ Rules Enforcing Whitespace Rule Group
8282
* `external_variable_name_102 <../external_variable_name_rules.html#external-variable-name-102>`_
8383
* `external_variable_name_103 <../external_variable_name_rules.html#external-variable-name-103>`_
8484
* `external_variable_name_104 <../external_variable_name_rules.html#external-variable-name-104>`_
85+
* `file_open_information_100 <../file_open_information_rules.html#file-open-information-100>`_
86+
* `file_open_information_101 <../file_open_information_rules.html#file-open-information-101>`_
87+
* `file_open_information_102 <../file_open_information_rules.html#file-open-information-102>`_
88+
* `file_open_information_103 <../file_open_information_rules.html#file-open-information-103>`_
8589
* `file_100 <../file_rules.html#file-100>`_
90+
* `file_101 <../file_rules.html#file-101>`_
8691
* `function_100 <../function_rules.html#function-100>`_
8792
* `function_101 <../function_rules.html#function-101>`_
8893
* `generate_002 <../generate_rules.html#generate-002>`_
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
architecture rtl of fifo is
3+
4+
file defaultImage : load_file_type open read_mode is load_file_name;
5+
6+
file defaultImage : load_file_type open read_mode is load_file_name;
7+
8+
begin
9+
10+
end architecture rtl;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
architecture rtl of fifo is
3+
4+
file defaultImage : load_file_type open read_mode is load_file_name;
5+
6+
file defaultImage : load_file_type open read_mode is load_file_name;
7+
8+
begin
9+
10+
end architecture rtl;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
architecture rtl of fifo is
3+
4+
file defaultImage : load_file_type open read_mode is load_file_name;
5+
6+
file defaultImage : load_file_type open read_mode is load_file_name;
7+
8+
begin
9+
10+
end architecture rtl;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
architecture rtl of fifo is
3+
4+
file defaultImage : load_file_type open read_mode is load_file_name;
5+
6+
file defaultImage : load_file_type open read_mode is load_file_name;
7+
8+
begin
9+
10+
end architecture rtl;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
architecture rtl of fifo is
3+
4+
file defaultImage : load_file_type open read_mode is load_file_name;
5+
6+
file defaultImage : load_file_type open read_mode is load_file_name;
7+
8+
begin
9+
10+
end architecture rtl;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
architecture rtl of fifo is
3+
4+
file defaultImage : load_file_type open read_mode is load_file_name;
5+
6+
file defaultImage : load_file_type open read_mode is load_file_name;
7+
8+
begin
9+
10+
end architecture rtl;

0 commit comments

Comments
 (0)