> Markdown version of [Editor Settings](https://vaadin.com/docs/latest/fr/contributing/editor-settings). Section index: [llms.txt](https://vaadin.com/docs/latest/fr/contributing/llms.txt)

# Paramètres de l’éditeur pour les contributeurs

Configurer votre environnement de développement comme le font les employés de Vaadin facilite la révision et l’acceptation des contributions de code.

## <a id="règles-générales-de-mise-en-forme"></a>Règles générales de mise en forme

- **Espaces au lieu de tabulations**

- **Encodage UTF-8**

- **Fins de ligne de style Unix** `\n`

## <a id="conventions-de-code"></a>Conventions de code

1. Ouvrez **Window** **›** **Preferences** (Windows) ou **Eclipse** **›** **Preferences** (Mac)

2. Sur la page **Java** **›** **Code Style** **›** **Formatter**, importez votre copie locale de [VaadinJavaConventions.xml](https://github.com/vaadin/flow/blob/main/eclipse/VaadinJavaConventions.xml)

3. Sur la page **Java** **›** **Code Style** **›** **Organize Imports**, importez votre copie locale de [flow.importorder](https://github.com/vaadin/flow/blob/main/eclipse/flow.importorder)

4. Dans l’onglet **Editor** **›** **Save Actions**, assurez-vous que si **Format source code** est actif, l’option **Format edited lines option** est sélectionnée. N’utilisez jamais l’option **Format all lines**, car cela peut introduire une grande quantité de modifications de code inutiles, rendant les revues de code cauchemardesques.

5. Allez dans **General** **›** **Workspace**

   1. Définissez **Text file encoding** sur **UTF-8**

   2. Définissez **New text file line delimiter** sur **Unix**

6. Allez dans **XML** **›** **XML Files** **›** **Editor** et assurez-vous que les paramètres sont configurés comme suit :

   - **Line width**: **80**

   - **Format comments**: **true**

   - **Join lines**: **true**

   - **Insert whitespace before closing empty end-tags**: **true**

   - **Indent using spaces**: **true**

   - **Indentation size**: **4**

**Eclipse**

```java
```

1. Installez le plugin **Eclipse Code Formatter**, puis redémarrez IDEA

2. Ouvrez **Settings** (`Ctrl`+`Alt`+`S` ou `⌘`+`,`)

3. Sur la page **Other Settings** **›** **Eclipse Code Formatter**

   1. Cochez **Use the Eclipse code formatter**

   2. Dans la section **Supported file types**, cochez **Enable Java**

   3. Dans **Eclipse Java Formatter config file**, parcourez jusqu’à votre copie locale de [VaadinJavaConventions.xml](https://github.com/vaadin/flow/blob/main/eclipse/VaadinJavaConventions.xml)

4. Allez dans **Editor** **›** **Code Style**, et définissez **Hard wrap at (columns)** sur **80**

**Imports**

1. Ouvrez **Settings** (`Ctrl`+`Alt`+`S` ou `⌘`+`,`)

2. Allez dans **Editor** **›** **General** **›** **Auto Import** et décochez **Optimize imports on the fly**

3. Allez dans **Editor** **›** **Code Style** **›** **Java** et dans l’onglet **Imports**

   1. Assurez-vous que **Use single class import** est coché

   2. Définissez à **99** à la fois **Class count to use import with '\*'** et **Names count to use static import with '\*'**

   3. Dans le volet **Import Layout**, assurez-vous que **Layout static imports separately** est coché

   4. Supprimez tous les packages dans la liste **Packages to Use Import with '\*'**

   5. Organisez les imports Java pour respecter la convention définie ci-dessous :

**IntelliJ IDEA**

```java
import javax.*
import java.*
<blank line>
import all other imports
<blank line>
import com.google.gwt.*
import com.vaadin.*
<blank line>
import elemental.*
import static all other imports
```

## <a id="mention-de-copyright"></a>Mention de copyright

Tous les fichiers de code source doivent inclure une mention de copyright au début du fichier.

1. Ouvrez **Window** **›** **Preferences** (Windows) ou **Eclipse** **›** **Preferences** (Mac)

2. Sur la page **Java** **›** **Code Style** **›** **Code Templates**, modifiez le modèle **Comments** **›** **Files** pour ajouter le texte de copyright :

**Eclipse**

```txt
Copyright 2000-${currentDate:date('yyyy')} Vaadin Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under
the License.
```

1. Ouvrez **Settings** (`Ctrl`+`Alt`+`S` ou `⌘`+`,`)

2. Allez dans **Editor** **›** **Copyright** **›** **Copyright Profiles** et créez un nouveau profil nommé **Vaadin**, avec le texte de copyright tel que défini ci-dessous.

3. Remontez d’un niveau, vers **Editor** **›** **Copyright**, et définissez **Default project copyright** sur le profil **Vaadin** que vous avez créé

**IntelliJ IDEA**

```txt
Copyright 2000-$today.year Vaadin Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under
the License.
```

`A0EF8ED7-DED5-454E-A5D0-DA4F9669F650`
