Current Series Release Notes¶
7.0.0¶
Upgrade Notes¶
The following checks have been removed:
H231 (incompatible
except x,y:
construct)H232 (incompatible octal format)
H233 (incompatible use of
print
operator)H234 (
assertEquals
/assertNotEquals
is deprecated)H235 (
assert_
is deprecated)H236 (incompatible
__metaclass__
)H237 (removed module)
H238 (old style classes)
These all checked for Python 3-incompatible code. They were disabled on Python 3 codebases and have therefore been no-ops for some time now.
5.0.0¶
Upgrade Notes¶
Support for Python 3.5 through 3.7 has been dropped. The minimum supported Python version is now 3.8.
hacking
is now compatible withflake8~=4.0.1
. flake8 3.x is no longer supported.
4.0.0¶
New Features¶
This release added new checks related to unittest module:
[H211] Change assertTrue(isinstance(A, B)) by optimal assert like assertIsInstance(A, B).
[H212] Change assertEqual(type(A), B) by optimal assert like assertIsInstance(A, B)
[H213] Check for usage of deprecated assertRaisesRegexp
[H214] Change assertTrue/False(A in/not in B, message) to the more specific assertIn/NotIn(A, B, message)
[H215] Change assertEqual(A in B, True), assertEqual(True, A in B), assertEqual(A in B, False) or assertEqual(False, A in B) to the more specific assertIn/NotIn(A, B)
3.0.0¶
Upgrade Notes¶
Python 2.7 support has been dropped. Last release of hacking to support py2.7 is OpenStack Train. The minimum version of Python now supported by hacking is Python 3.5.
2.0.0¶
New Features¶
hacking is now compatible with flake8 3.x, which is a large rewrite of flake8. flake8 2.x is no longer supported.
Upgrade Notes¶
Support for local checks has been removed. This was not compatible with flake8 3.x. Users should migrate to the flake8’s native local plugins support.
1.1.0¶
Prelude¶
This release includes below changes:
Transition to flake8 2.6.x:
flake8 2.6.x performed the conversion to pycodestyle (which is the new name of pep8). Remove the explicit dependencies of hacking as flake8 is going to pull in mccabe, pyflakes and pycodestyle in the versions that are needed.
Allow ‘wraps’ to be an alternative to autospec:
Don’t cause an H210 error if the mock.patch/mock.patch.object call uses the ‘wraps’ keyword. As that serves the same purpose in catching wrong attributes.
1.0.0¶
New Features¶
This release includes new checks, which are disabled by default:
[H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls
[H204] Use assert(Not)Equal to check for equality.
[H205] Use assert(Greater|Less)(Equal) for comparison.