ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame^] | 1 | // |
| 2 | // ============LICENSE_START======================================================= |
| 3 | // Copyright (C) 2016-2018 Ericsson. All rights reserved. |
| 4 | // ================================================================================ |
| 5 | // This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE |
| 6 | // Full license text at https://creativecommons.org/licenses/by/4.0/legalcode |
| 7 | // |
| 8 | // SPDX-License-Identifier: CC-BY-4.0 |
| 9 | // ============LICENSE_END========================================================= |
| 10 | // |
| 11 | // @author Sven van der Meer (sven.van.der.meer@ericsson.com) |
| 12 | // |
| 13 | |
| 14 | == Supress Checkstyle (partially) |
| 15 | |
| 16 | Sometimes Checkstyle checks identify code that does not comply with Checkstyle rules. |
| 17 | In limited cases Checkstyle rules can be suppressed, for example where it is impossible to design the code in a way that complies with Checkstyle or where the Checkstyle rule is impossible to apply. |
| 18 | Checkstyle rules are suppressed as is explained in this link:https://stackoverflow.com/questions/4023185/how-to-disable-a-particular-checkstyle-rule-for-a-particular-line-of-code[Stackoverflow post]. |
| 19 | |
| 20 | The example below illustrates how to suppress a Checkstyle rule that specifies all methods must have seven parameters or less. |
| 21 | |
| 22 | [source%nowrap,java,numbered] |
| 23 | ---- |
| 24 | // CHECKSTYLE:OFF: checkstyle:ParameterNumber |
| 25 | public myMethod(final int par1, final int par2, final int par3, final int par4, |
| 26 | final int par5, final int par6, final int par7, final int par8) { |
| 27 | } |
| 28 | // CHECKSTYLE:ON: checkstyle:ParameterNumber |
| 29 | ---- |
| 30 | |
| 31 | |