mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Don't force public variables to use Hungarian notation (#8774)
People generally have expressed a dislike for the Hungarian notation used in member variables, especially in examples/templates, and our styleguide shouldn't be forced on downstream consumers, so this removes all Hungarian notation from the examples/templates. There are _some_ benefits to Hungarian for private member variables (like knowing what's a member vs. local in a PR review) so we'll keep private member variables the same for now, but public variables should no longer use Hungarian notation, since it looks much worse. A new PMD XPath rule has been added to accomplish this goal. Some other non-compliant variables were fixed for the new rule.
This commit is contained in:
@@ -13,6 +13,7 @@ import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class CleanupPoolTest {
|
||||
@SuppressWarnings("PMD.PublicFieldNamingConvention")
|
||||
static class AutoCloseableObject implements AutoCloseable {
|
||||
public boolean m_closed;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class ReflectionCleanupTest {
|
||||
@SuppressWarnings("PMD.PublicFieldNamingConvention")
|
||||
static class CleanupClass implements AutoCloseable {
|
||||
public boolean m_closed;
|
||||
|
||||
@@ -19,7 +20,7 @@ class ReflectionCleanupTest {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.TestClassWithoutTestCases")
|
||||
@SuppressWarnings({"PMD.TestClassWithoutTestCases", "PMD.PublicFieldNamingConvention"})
|
||||
static class CleanupTest implements ReflectionCleanup {
|
||||
public CleanupClass m_class1 = new CleanupClass();
|
||||
public CleanupClass m_class2 = new CleanupClass();
|
||||
@@ -32,6 +33,7 @@ class ReflectionCleanupTest {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.PublicFieldNamingConvention")
|
||||
static class CleanupTest2 extends CleanupTest {
|
||||
@SkipCleanup public CleanupClass m_class3 = new CleanupClass();
|
||||
public CleanupClass m_class4 = new CleanupClass();
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
|
||||
class DynamicStructTest {
|
||||
@SuppressWarnings("MemberName")
|
||||
private StructDescriptorDatabase db;
|
||||
|
||||
@BeforeEach
|
||||
|
||||
Reference in New Issue
Block a user