korijn / flake8-self Goto Github PK
View Code? Open in Web Editor NEWprivate member access linting plugin for flake8
License: MIT License
private member access linting plugin for flake8
License: MIT License
First of all, thank you for this plugin! :)
I found a possible false positive... with a code like:
class Foo(object):
_cls_private_thing = 'foo'
@classmethod
def class_fn(cls):
print(cls._cls_private_thing) # SLF001 Private member access
It raises private member access error, but it is a legal access (inside the class).
IMHO, It should work with conventions like cls or mcs (metaclass)
Hi,
First off - very neat plugin - great for enforcing best practices.
I have been looking for something which enforces more of a Java-style access modifier behaviour though. In the current implementation here, there is no semantic difference between a protected (_single leading underscore) and a private (__double leading underscore) attributes. It would be very useful to disambiguate the two, and allow a configuration where we allow three access levels:
I have two use cases for this:
Having a dyad where we allow object A to modify object B in a safe way. i.e. without having to expose those methods in the public API of B, and still get the benefits of disallowing access to those members from outside the module/package.
Unit testing protected methods which I don't want exposed in the public API, while still retaining the possibility of completely hiding private methods to ensure that we test behaviour and not implementation.
What are your thoughts? Is this something that would be relatively easy to add? I'm not very familiar with ASTs in Python but I would be happy to try to implement this extension myself, if you could point me in the right direction.
Both flake8 itself and all the other flake8 plugins I have used have three digit numbers, so why not here?
Hi there, we would love to use your project as a dependency for an upcoming effort and are wondering if you might be open to providing a license for our team's compliance requirements.
Thanks for your help and consideration!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.