Repository: Korijn/flake8-self

Issue:
3 digit validation codes
Both flake8 itself and all the other flake8 plugins I have used have three digit numbers, so why not here?

Discussion:
peterjc: The changes too good to me.

You don't have a CHANGELOG or release notes section in the README file, do you?

Korijn: Not yet. This is the first change relative to public release of this little library! I'll add a changelog.

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..5535097
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,14 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+### Changed
+- #2 Updated violation code from SF01 to SLF001, thanks to @peterjc
+
+
+## [0.2.2] - 2018-04-28
+### Added
+- Initial release.
diff --git a/README.md b/README.md
index 432aedd..02af878 100644
--- a/README.md
+++ b/README.md
@@ -8,8 +8,8 @@ Private member access linting plugin for flake8.
 
 ```
 > pipenv run flake8 example.py
-example.py:10:1: SF01 Private member access
-example.py:11:1: SF01 Private member access
+example.py:10:1: SLF001 Private member access
+example.py:11:1: SLF001 Private member access
 ```
 
 example.py:
@@ -23,7 +23,7 @@ class Foo(object):
 
 foo = Foo()
 print(foo.public_thing)
-print(foo._private_thing)  # SF01 Private member access
-print(foo.__really_private_thing)  # SF01 Private member access
+print(foo._private_thing)  # SLF001 Private member access
+print(foo.__really_private_thing)  # SLF001 Private member access
 print(foo.__dict__)
 ```
diff --git a/example.py b/example.py
index 24a8293..65e04da 100644
--- a/example.py
+++ b/example.py
@@ -7,6 +7,6 @@ class Foo(object):
 
 foo = Foo()
 print(foo.public_thing)
-print(foo._private_thing)  # SF01 Private member access
-print(foo.__really_private_thing)  # SF01 Private member access
+print(foo._private_thing)  # SLF001 Private member access
+print(foo.__really_private_thing)  # SLF001 Private member access
 print(foo.__dict__)
diff --git a/flake8_self.py b/flake8_self.py
index 847acf5..0d371d1 100644
--- a/flake8_self.py
+++ b/flake8_self.py
@@ -1,8 +1,8 @@
 import ast
 
-__version__ = '0.2.2'
+__version__ = '0.3.0'
 
-ERRORS_SF01 = 'SF01 Private member access'
+ERRORS_SLF001 = 'SLF001 Private member access'
 
 
 def is_private_attribute(attr):
@@ -40,4 +40,4 @@ class SelfLinter(object):
         visitor = SelfVisitor()
         visitor.visit(self.tree)
         for access_violation in visitor.access_violations:
-            yield access_violation.lineno, 0, ERRORS_SF01, type(self)
+            yield access_violation.lineno, 0, ERRORS_SLF001, type(self)
diff --git a/setup.py b/setup.py
index e231a80..c2203cd 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@ setup(
     zip_safe=False,
     entry_points={
         'flake8.extension': [
-            'SF01 = flake8_self:SelfLinter',
+            'SLF001 = flake8_self:SelfLinter',
         ],
     },
     install_requires=["flake8"],


Test patch:
diff --git a/test_self.py b/test_self.py
index 8941423..ed4f9cf 100644
--- a/test_self.py
+++ b/test_self.py
@@ -19,6 +19,6 @@ print(foo.__dict__)"""
     violations = list(flake8_self.SelfLinter(tree).run())
     assert len(violations) == 2
     assert violations[0][0] == 9
-    assert violations[0][2] == flake8_self.ERRORS_SF01
+    assert violations[0][2] == flake8_self.ERRORS_SLF001
     assert violations[1][0] == 10
-    assert violations[1][2] == flake8_self.ERRORS_SF01
+    assert violations[1][2] == flake8_self.ERRORS_SLF001