-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Integrate flake8_rst into ./ci/code_check.sh #23381
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8325caf
Add flake8-rst
FHaase 226bc53
Fixed PEP8 issues in docstrings
FHaase 472df59
Fixing PEP8 issues within code-blocks
FHaase 11a3632
Fixing PEP8 issues
FHaase 7fd215d
Fixing PEP8 issues
FHaase d1be499
Fixing PEP8 issues
FHaase acea30a
Fixing PEP8 issues
FHaase bc6d6f7
Merge branch 'master' into feature/flake8-rst
FHaase 77df97f
Fix travis build
FHaase 67cf043
revert back to minimal changes in doc folder
FHaase f440c63
Merge branch 'master' into feature/flake8-rst
FHaase 948f176
Cleanup
FHaase c01e22d
Optional noqa removes
FHaase 816f26e
Merge remote-tracking branch 'upstream/master' into feature/flake8-rst
FHaase 1a4c6fe
Merge remote-tracking branch 'upstream/master' into feature/flake8-rst
FHaase ed17b45
Merge branch 'master' of github.com:pandas-dev/pandas into feature/fl…
FHaase File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Cython>=0.28.2 | |
NumPy | ||
flake8 | ||
flake8-comprehensions | ||
flake8-rst | ||
hypothesis>=3.58.0 | ||
isort | ||
moto | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -744,15 +744,15 @@ Transitioning to ``pytest`` | |
.. code-block:: python | ||
|
||
class TestReallyCoolFeature(object): | ||
.... | ||
.... # noqa: E999 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @WillAyd Would you prefer a |
||
|
||
Going forward, we are moving to a more *functional* style using the `pytest <http://docs.pytest.org/en/latest/>`__ framework, which offers a richer testing | ||
framework that will facilitate testing and developing. Thus, instead of writing test classes, we will write test functions like this: | ||
|
||
.. code-block:: python | ||
|
||
def test_really_cool_feature(): | ||
.... | ||
.... # noqa: E999 | ||
|
||
Using ``pytest`` | ||
~~~~~~~~~~~~~~~~ | ||
|
@@ -777,25 +777,32 @@ We would name this file ``test_cool_feature.py`` and put in an appropriate place | |
import pandas as pd | ||
from pandas.util import testing as tm | ||
|
||
|
||
@pytest.mark.parametrize('dtype', ['int8', 'int16', 'int32', 'int64']) | ||
def test_dtypes(dtype): | ||
assert str(np.dtype(dtype)) == dtype | ||
|
||
@pytest.mark.parametrize('dtype', ['float32', | ||
pytest.param('int16', marks=pytest.mark.skip), | ||
pytest.param('int32', | ||
marks=pytest.mark.xfail(reason='to show how it works'))]) | ||
|
||
@pytest.mark.parametrize('dtype', | ||
['float32', | ||
pytest.param('int16', marks=pytest.mark.skip), | ||
pytest.param('int32', marks=pytest.mark.xfail( | ||
reason='example')) | ||
]) | ||
def test_mark(dtype): | ||
assert str(np.dtype(dtype)) == 'float32' | ||
|
||
|
||
@pytest.fixture | ||
def series(): | ||
return pd.Series([1, 2, 3]) | ||
|
||
|
||
@pytest.fixture(params=['int8', 'int16', 'int32', 'int64']) | ||
def dtype(request): | ||
return request.param | ||
|
||
|
||
def test_series(series, dtype): | ||
result = series.astype(dtype) | ||
assert result.dtype == dtype | ||
|
@@ -864,6 +871,7 @@ for details <https://hypothesis.readthedocs.io/en/latest/index.html>`_. | |
st.lists(any_json_value), st.dictionaries(st.text(), any_json_value) | ||
)) | ||
|
||
|
||
@given(value=any_json_value) | ||
def test_json_roundtrip(value): | ||
result = json.loads(json.dumps(value)) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the point of changing this? We always ask changes to have one focus to keep diff minimal. Would prefer if you could back out anything unrelated to the flake8 and do in a separate PR