Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flake8 W503 and W504 #10

Closed
carriepl opened this issue Aug 11, 2020 · 2 comments
Closed

Flake8 W503 and W504 #10

carriepl opened this issue Aug 11, 2020 · 2 comments
Labels
invalid This doesn't seem right

Comments

@carriepl
Copy link

The current config makes flake8 enforce both W503 and W504 warnings which is contradictory.

W503 is "line break before binary operator" which prohibits the following :

x = ((some computation)
     + (some other computation))

W504 is "line break before binary operator" which prohibits the following :

x = ((some computation) +
     (some other computation))

Having both warnings on mean that we simply can have a line break in the vicinity of a binary operator.

According to the pep8 style guide (https://www.python.org/dev/peps/pep-0008/#id20) the recommendation used to be to have linebreaks after the binary operator but is now to have them before (since 2016 according to a discussion I saw on StackOverflow). Both styles are considered permissible so long as the code is locally consistent.

I think that at least one of those warning should be disabled. However, since both styles are permissible, disabling both would also be an option.

@carriepl carriepl added bug Something isn't working invalid This doesn't seem right and removed bug Something isn't working labels Aug 11, 2020
@mirkobronzi
Copy link
Collaborator

interesting - flake8 says that the tool should be updated to not enforce W503 (https://www.flake8rules.com/rules/W503.html), but it's still there..
Probably both the option of disabling W503 - or W503 and W04 are viable.

I f we assume that flake8 made their mind about this, my preference would go to disable W503 only.

I'll add a pointer to this issue to the things to discuss before next cookiecutter.

@mirkobronzi
Copy link
Collaborator

solved in #21

ChrisHirsch added a commit to Raptacon/Robot-2021 that referenced this issue Sep 11, 2021
ChrisHirsch added a commit to Raptacon/Robot-2021 that referenced this issue Sep 11, 2021
* Registered the 'x' button in robot.py to enable the solenoid on push and disable on release


* Switched from using bad method
Used Xboxmap.getmechY(), that method no longer exist. Now used a
different variable

* Moved testBot.py to testSensors and commented code

* For PR#73 added back in the comment for the 3200 robot base class

* Removed self.motors

* Removed the unit tests agian...accidental add

* camelCasing
camelCased the shooterMotorsVariable

* Brakes
Brake mode on spark maxes is now changable through the key 'Brake' and
True or False

* Changed brake name
now to change Idle mode, use IdleBrake and True/False in config.yml

* Added config searching. Uses file stored in home dir to get name of
config file. If not found fallsback to default

* Changed names
Changed names of joystick. Changed names of ShooterMotors to
shooterMotors for camelCasing reasons

* updated minibot config to match minibot

* Fixed PIP8 linting

* State machine shooter (#73)

* Added ready to fire

* Improved sensor logic

* Added Sensor Logic 

* Joystick control

* Added button callback for shooter activation

* Mostly working manual/automatic shoot; crashes when more than 4 balls loaded in automatic

* Added elevator to config.yml

* Component mapper is reworked.
Added ability to check compatibility strings in components. THis will
attempt to disable them if not compatible.
Moved motorHelper
Moved motor creation to robot
updated configs for new component mapper
Tested on sim with minibot, scorpion, and doof for drive train
functionality

* Component refactor and change to elevator so that it uses the new motors_loader rather than the old motorsList



* State machine shooter refactor (#85)

Refactored shooter code to be state based.
Added automatic shooter mode.

* Windows package install script (#87)

* added initial code

* Added robotpy to installer and added requirements files

* Changed working directory and updated gitignore

* Moved into the script folder into "utils" as it is a utility

* Improve config (#88)

* Added more config componets
added more factories
configured pneumatics to use new factories

* cleaned up control types
added gyro refernce to drive train

* Sensitivity (#86)

* Sensitivity
applies a ^1.6 curve to the right/left drive controller input in
robot.py's initPeriodic

* Adds current limit methods
Tested, works with ctre/rev controllers

* changed to use tank mode, inverted all motor (#95)

* Shooter callbacks (#96)

* added calculateRPM() and changed findConfig()
findConfig now has an argument for the name of the config. The only time this is
currently used is to find the robot config but I'm planning to use it to
store values for RPM calculations so I added the argument so I could use the
method to find the yml.

* switching to linear curve
Instead of equation, find point behind and in front of current distance
and approximate

* ci: 🎡 ignore ONLY W503 and keep W504
per mila-iqia/cookiecutter-pyml#10 this is
what's now recommended

Co-authored-by: DrKittyKat <43834685+DrKittyKat@users.noreply.github.com>
Co-authored-by: cannedlock <zwinter03@gmail.com>
Co-authored-by: Chris Hirsch <chris@base2technology.com>
Co-authored-by: cannedlock <56943162+cannedlock@users.noreply.github.com>
Co-authored-by: Nathan Beasley <tuffinmuffin@gmail.com>
Co-authored-by: hell0w0rld2 <43834630+hell0w0rld2@users.noreply.github.com>
Co-authored-by: DriveDE <eric.hall08@gmail.com>
Co-authored-by: unknown <ehsraptacon3200@gmail.com>
dwhensley added a commit to innolitics/n2y that referenced this issue May 27, 2023
- Raise `UseNextClass` if `block` sent to the constructor is `None`.
- Check if a user mentions a footnote in a DB on a different page. I.e.,
  enforce that the DB with footnotes being mentioned must be a child of
  the original page (e.g., an inline DB). Raise a `PluginError` with
  helpful information to track down the offending mention.
- Added W503 and W504 to the `flake8` ignore list. See this closed PR:
  mila-iqia/cookiecutter-pyml#10. These were
  both active and causing contradictory warnings impossible to fix.
- Update tests accordingly for new changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants