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