How to disable special naming convention inspection of PEP 8 in PyCharm

Since PyCharm 2.7 you can hover over the inspected code and use the to Ignore errors like this. Further more you can manage the ignored errors at Settings > Editor > Inspections > Python > PEP 8 naming convention violation > Ignored errors Tested in PyCharm Community Edition 2016.3.2 Edit: To remove the modification later … Read more

PEP8 naming convention on test classes

The documentation for unittest suggests, e.g.: class TestSequenceFunctions(unittest.TestCase): def test_shuffle(self): … def test_choice(self): … commenting The three individual tests are defined with methods whose names start with the letters test. This naming convention informs the test runner about which methods represent tests.

Pycharm’s code style inspection: ignore/switch off specific rules

Using PyCharm 5 (community edition), you can do the following: Code –> Inspect Code. Then select the required inspection error, and click on the “Suppress” option or “Ignore errors like this” option on right hand side. Please look at the screenshot below: When you choose the “Suppress” option, it adds a comment as shown in … Read more

What is the recommended way to break a long if statement? (W504 line break after binary operator)

If we consult the documentation on flake 8 we see: Anti-pattern Note: Despite being in the anti-pattern section, this will soon be considered the best practice. income = (gross_wages + taxable_interest) Best practice Note: Despite being in the best practice section, this will soon be considered an anti-pattern. income = (gross_wages + taxable_interest) So the … Read more

How should I format a long url in a python comment and still be PEP8 compliant

Don’t break the url: Some other good reasons to ignore a particular guideline: When applying the guideline would make the code less readable, even for someone who is used to reading code that follows this PEP. … Source: # A Foolish Consistency is the Hobgoblin of Little Minds [1] # [1]: http://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds You can use … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)