Code Monkey home page Code Monkey logo

flake8-self's People

Contributors

dannyzen avatar korijn avatar ngnpope avatar nijel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flake8-self's Issues

cls private access false positive

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)

Allow protected member access within same package

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:

  • Visible to the class only (private).
  • Visible to the package (or potentially only module) and all subclasses (protected).
  • Visible to the world (public).

I have two use cases for this:

  1. 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.

  2. 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.

3 digit validation codes

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

Addition of a LICENSE

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.