@@ -7,8 +7,8 @@ coding standards and conventions used in the core framework to make it more
7
7
consistent and predictable. You are encouraged to follow them in your own
8
8
code, but you don't need to.
9
9
10
- Method Names
11
- ------------
10
+ Naming a Method
11
+ ---------------
12
12
13
13
When an object has a "main" many relation with related "things"
14
14
(objects, parameters, ...), the method names are normalized:
@@ -77,19 +77,63 @@ must be used instead (where ``XXX`` is the name of the related thing):
77
77
``replaceXXX() ``, on the other hand, cannot add new elements. If an unrecognized
78
78
key is passed to ``replaceXXX() `` it must throw an exception.
79
79
80
+ Writing a CHANGELOG Entry
81
+ -------------------------
82
+
83
+ When adding a new feature in a minor version or deprecating an existing
84
+ behavior, an entry to the relevant CHANGELOG(s) should be added.
85
+
86
+ New features and deprecations must be described in a file named
87
+ ``CHANGELOG.md `` that should be at the root directory of the modified
88
+ Component/Bridge/Bundle.
89
+
90
+ The file must be written with the Markdown syntax and follow the following
91
+ conventions:
92
+
93
+ * The main title is always ``CHANGELOG ``;
94
+
95
+ * Each entry must be added to a minor version section (like ``5.3 ``) as a list
96
+ element;
97
+
98
+ * No third level sections are allowed;
99
+
100
+ * Messages should follow the commit message conventions: should be short,
101
+ capitalize the line, do not end with a period, use an imperative verb to
102
+ start the line;
103
+
104
+ * New entries must be added on top of the list.
105
+
106
+ Here is a complete example for reference:
107
+
108
+ .. code-block :: markdown
109
+
110
+ CHANGELOG
111
+ =========
112
+
113
+ 5.3
114
+ ---
115
+
116
+ * Add `MagicConfig` that allows configuring things
117
+
118
+ .. note ::
119
+
120
+ The main ``CHANGELOG-* `` files at the ``symfony/symfony `` root directory
121
+ are automatically generated when releases are prepared and should never be
122
+ modified "manually".
123
+
80
124
.. _contributing-code-conventions-deprecations :
81
125
82
126
Deprecating Code
83
127
----------------
84
128
85
- From time to time, some classes and/or methods are deprecated in the
86
- framework; that happens when a feature implementation cannot be changed
87
- because of backward compatibility issues, but we still want to propose a
88
- "better" alternative. In that case, the old implementation can be **deprecated **.
129
+ From time to time, some classes and/or methods are deprecated in the framework;
130
+ that happens when a feature implementation cannot be changed because of
131
+ backward compatibility issues, but we still want to propose a "better"
132
+ alternative. In that case, the old implementation can be **deprecated **.
89
133
90
134
Deprecations must only be introduced on the next minor version of the impacted
91
- component (or bundle, or bridge, or contract).
92
- They can exceptionally be introduced on previous supported versions if they are critical.
135
+ component (or bundle, or bridge, or contract). They can exceptionally be
136
+ introduced on previous supported versions if they are critical.
93
137
94
138
A new class (or interface, or trait) cannot be introduced as deprecated, or
95
139
contain deprecated methods.
@@ -144,26 +188,28 @@ after the use declarations, like in this example from
144
188
145
189
The deprecation must be added to the ``CHANGELOG.md `` file of the impacted component::
146
190
147
- 4.4.0
148
- -----
191
+ 4.4
192
+ ---
149
193
150
- * Deprecated the `Deprecated` class, use `Replacement` instead.
194
+ * Deprecate the `Deprecated` class, use `Replacement` instead
151
195
152
196
It must also be added to the ``UPGRADE.md `` file of the targeted minor version
153
197
(``UPGRADE-4.4.md `` in our example)::
154
198
155
199
DependencyInjection
156
200
-------------------
157
201
158
- * Deprecated the `Deprecated` class, use `Replacement` instead.
202
+ * Deprecate the `Deprecated` class, use `Replacement` instead
159
203
160
204
Finally, its consequences must be added to the ``UPGRADE.md `` file of the next major version
161
- (``UPGRADE-5.0.md `` in our example)::
205
+ (``UPGRADE-5.0.md `` in our example):
206
+
207
+ .. code-block :: markdown
162
208
163
209
DependencyInjection
164
210
-------------------
165
211
166
- * Removed the `Deprecated` class, use `Replacement` instead.
212
+ * Remove the `Deprecated` class, use `Replacement` instead
167
213
168
214
All these tasks are mandatory and must be done in the same pull request.
169
215
@@ -174,12 +220,14 @@ Removing deprecated code can only be done once every 2 years, on the next major
174
220
impacted component (``master `` branch).
175
221
176
222
When removing deprecated code, the consequences of the deprecation must be added to the ``CHANGELOG.md `` file
177
- of the impacted component::
223
+ of the impacted component:
224
+
225
+ .. code-block :: markdown
178
226
179
- 5.0.0
180
- -----
227
+ 5.0
228
+ ---
181
229
182
- * Removed the `Deprecated` class, use `Replacement` instead.
230
+ * Remove the `Deprecated` class, use `Replacement` instead
183
231
184
232
This task is mandatory and must be done in the same pull request.
185
233
0 commit comments