From 3cf204a4336ade29d2a611c6bca8328a8319b5d3 Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Tue, 6 Oct 2020 23:54:41 +0100 Subject: [PATCH] CI add end-of-file-fixer (#36826) --- .github/CODE_OF_CONDUCT.md | 1 - .pre-commit-config.yaml | 5 +++++ AUTHORS.md | 1 - ci/travis_process_gbq_encryption.sh | 1 - doc/data/iris.data | 2 +- doc/source/development/contributing.rst | 3 +++ doc/source/development/developer.rst | 2 +- doc/source/getting_started/intro_tutorials/index.rst | 1 - doc/source/getting_started/overview.rst | 1 - doc/source/reference/general_utility_functions.rst | 1 - doc/source/whatsnew/v0.14.0.rst | 2 +- flake8/cython-template.cfg | 1 - pandas/_libs/src/klib/khash_python.h | 2 +- pandas/_libs/util.pxd | 1 - pandas/tests/io/json/data/tsframe_iso_v012.json | 2 +- pandas/tests/io/json/data/tsframe_v012.json | 2 +- requirements-dev.txt | 2 +- scripts/generate_pip_deps_from_conda.py | 2 +- setup.cfg | 1 - web/pandas/community/coc.md | 1 - 20 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 7dd2e04249492..87a5b7905fc6d 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -60,4 +60,3 @@ and the [Swift Code of Conduct][swift]. [homepage]: https://www.contributor-covenant.org [version]: https://www.contributor-covenant.org/version/1/3/0/ [swift]: https://swift.org/community/#code-of-conduct - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a311c6f702e8..33afe8d443457 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,3 +47,8 @@ repos: rev: v1.2.2 hooks: - id: yesqa +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: end-of-file-fixer + exclude: '.html$|^LICENSES/|.csv$|.txt$|.svg$|.py$' diff --git a/AUTHORS.md b/AUTHORS.md index f576e333f9448..84fcfe05e3043 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -54,4 +54,3 @@ pandas is distributed under a 3-clause ("Simplified" or "New") BSD license. Parts of NumPy, SciPy, numpydoc, bottleneck, which all have BSD-compatible licenses, are included. Their licenses follow the pandas license. - diff --git a/ci/travis_process_gbq_encryption.sh b/ci/travis_process_gbq_encryption.sh index fccf8e1e8deff..b5118ad5defc6 100755 --- a/ci/travis_process_gbq_encryption.sh +++ b/ci/travis_process_gbq_encryption.sh @@ -10,4 +10,3 @@ elif [[ -n ${!TRAVIS_IV_ENV} ]]; then export GBQ_PROJECT_ID='pandas-gbq-tests'; echo 'Successfully decrypted gbq credentials' fi - diff --git a/doc/data/iris.data b/doc/data/iris.data index c19b9c3688515..026e214e5f754 100644 --- a/doc/data/iris.data +++ b/doc/data/iris.data @@ -148,4 +148,4 @@ SepalLength,SepalWidth,PetalLength,PetalWidth,Name 6.3,2.5,5.0,1.9,Iris-virginica 6.5,3.0,5.2,2.0,Iris-virginica 6.2,3.4,5.4,2.3,Iris-virginica -5.9,3.0,5.1,1.8,Iris-virginica \ No newline at end of file +5.9,3.0,5.1,1.8,Iris-virginica diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 17eba825d1c29..ba5530dcbd3ba 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -837,6 +837,9 @@ to run its checks by running:: without having to have done ``pre-commit install`` beforehand. +Note that if you have conflicting installations of ``virtualenv``, then you may get an +error - see `here `_. + Backwards compatibility ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/source/development/developer.rst b/doc/source/development/developer.rst index bdbcf5ca337b8..d701208792a4c 100644 --- a/doc/source/development/developer.rst +++ b/doc/source/development/developer.rst @@ -184,4 +184,4 @@ As an example of fully-formed metadata: 'creator': { 'library': 'pyarrow', 'version': '0.13.0' - }} \ No newline at end of file + }} diff --git a/doc/source/getting_started/intro_tutorials/index.rst b/doc/source/getting_started/intro_tutorials/index.rst index 28e7610866461..c67e18043c175 100644 --- a/doc/source/getting_started/intro_tutorials/index.rst +++ b/doc/source/getting_started/intro_tutorials/index.rst @@ -19,4 +19,3 @@ Getting started tutorials 08_combine_dataframes 09_timeseries 10_text_data - diff --git a/doc/source/getting_started/overview.rst b/doc/source/getting_started/overview.rst index 3043cf25c5312..3d8108d78ac89 100644 --- a/doc/source/getting_started/overview.rst +++ b/doc/source/getting_started/overview.rst @@ -174,4 +174,3 @@ License ------- .. literalinclude:: ../../../LICENSE - diff --git a/doc/source/reference/general_utility_functions.rst b/doc/source/reference/general_utility_functions.rst index 3cba0a81a7011..37fe980dbf68c 100644 --- a/doc/source/reference/general_utility_functions.rst +++ b/doc/source/reference/general_utility_functions.rst @@ -122,4 +122,3 @@ Bug report function :toctree: api/ show_versions - diff --git a/doc/source/whatsnew/v0.14.0.rst b/doc/source/whatsnew/v0.14.0.rst index 421ef81427210..f2401c812a979 100644 --- a/doc/source/whatsnew/v0.14.0.rst +++ b/doc/source/whatsnew/v0.14.0.rst @@ -1084,4 +1084,4 @@ Bug fixes Contributors ~~~~~~~~~~~~ -.. contributors:: v0.13.1..v0.14.0 \ No newline at end of file +.. contributors:: v0.13.1..v0.14.0 diff --git a/flake8/cython-template.cfg b/flake8/cython-template.cfg index 61562bd7701b1..3d7b288fd8055 100644 --- a/flake8/cython-template.cfg +++ b/flake8/cython-template.cfg @@ -1,4 +1,3 @@ [flake8] filename = *.pxi.in select = E501,E302,E203,E111,E114,E221,E303,E231,E126,F403 - diff --git a/pandas/_libs/src/klib/khash_python.h b/pandas/_libs/src/klib/khash_python.h index 82251744915a5..2b46d30c3adb6 100644 --- a/pandas/_libs/src/klib/khash_python.h +++ b/pandas/_libs/src/klib/khash_python.h @@ -121,4 +121,4 @@ void PANDAS_INLINE kh_destroy_str_starts(kh_str_starts_t* table) { void PANDAS_INLINE kh_resize_str_starts(kh_str_starts_t* table, khint_t val) { kh_resize_str(table->table, val); -} \ No newline at end of file +} diff --git a/pandas/_libs/util.pxd b/pandas/_libs/util.pxd index 828bccf7d5641..5f234910deede 100644 --- a/pandas/_libs/util.pxd +++ b/pandas/_libs/util.pxd @@ -48,4 +48,3 @@ cdef inline void set_array_not_contiguous(ndarray ao) nogil: # ao->flags &= ~(NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS); PyArray_CLEARFLAGS(ao, (NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS)) - diff --git a/pandas/tests/io/json/data/tsframe_iso_v012.json b/pandas/tests/io/json/data/tsframe_iso_v012.json index bd9ff885ad23a..5fa01d5cd902d 100644 --- a/pandas/tests/io/json/data/tsframe_iso_v012.json +++ b/pandas/tests/io/json/data/tsframe_iso_v012.json @@ -1 +1 @@ -{"A":{"2000-01-03T00:00:00":1.56808523,"2000-01-04T00:00:00":-0.2550111,"2000-01-05T00:00:00":1.51493992,"2000-01-06T00:00:00":-0.02765498,"2000-01-07T00:00:00":0.05951614},"B":{"2000-01-03T00:00:00":0.65727391,"2000-01-04T00:00:00":-0.08072427,"2000-01-05T00:00:00":0.11805825,"2000-01-06T00:00:00":0.44679743,"2000-01-07T00:00:00":-2.69652057},"C":{"2000-01-03T00:00:00":1.81021139,"2000-01-04T00:00:00":-0.03202878,"2000-01-05T00:00:00":1.629455,"2000-01-06T00:00:00":0.33192641,"2000-01-07T00:00:00":1.28163262},"D":{"2000-01-03T00:00:00":-0.17251653,"2000-01-04T00:00:00":-0.17581665,"2000-01-05T00:00:00":-1.31506612,"2000-01-06T00:00:00":-0.27885413,"2000-01-07T00:00:00":0.34703478},"date":{"2000-01-03T00:00:00":"1992-01-06T18:21:32.120000","2000-01-04T00:00:00":"1992-01-06T18:21:32.120000","2000-01-05T00:00:00":"1992-01-06T18:21:32.120000","2000-01-06T00:00:00":"2013-01-01T00:00:00","2000-01-07T00:00:00":"1992-01-06T18:21:32.120000"}} \ No newline at end of file +{"A":{"2000-01-03T00:00:00":1.56808523,"2000-01-04T00:00:00":-0.2550111,"2000-01-05T00:00:00":1.51493992,"2000-01-06T00:00:00":-0.02765498,"2000-01-07T00:00:00":0.05951614},"B":{"2000-01-03T00:00:00":0.65727391,"2000-01-04T00:00:00":-0.08072427,"2000-01-05T00:00:00":0.11805825,"2000-01-06T00:00:00":0.44679743,"2000-01-07T00:00:00":-2.69652057},"C":{"2000-01-03T00:00:00":1.81021139,"2000-01-04T00:00:00":-0.03202878,"2000-01-05T00:00:00":1.629455,"2000-01-06T00:00:00":0.33192641,"2000-01-07T00:00:00":1.28163262},"D":{"2000-01-03T00:00:00":-0.17251653,"2000-01-04T00:00:00":-0.17581665,"2000-01-05T00:00:00":-1.31506612,"2000-01-06T00:00:00":-0.27885413,"2000-01-07T00:00:00":0.34703478},"date":{"2000-01-03T00:00:00":"1992-01-06T18:21:32.120000","2000-01-04T00:00:00":"1992-01-06T18:21:32.120000","2000-01-05T00:00:00":"1992-01-06T18:21:32.120000","2000-01-06T00:00:00":"2013-01-01T00:00:00","2000-01-07T00:00:00":"1992-01-06T18:21:32.120000"}} diff --git a/pandas/tests/io/json/data/tsframe_v012.json b/pandas/tests/io/json/data/tsframe_v012.json index d4474c767855c..1d6a0a45c028e 100644 --- a/pandas/tests/io/json/data/tsframe_v012.json +++ b/pandas/tests/io/json/data/tsframe_v012.json @@ -1 +1 @@ -{"A":{"946857600000000000":1.56808523,"946944000000000000":-0.2550111,"947030400000000000":1.51493992,"947116800000000000":-0.02765498,"947203200000000000":0.05951614},"B":{"946857600000000000":0.65727391,"946944000000000000":-0.08072427,"947030400000000000":0.11805825,"947116800000000000":0.44679743,"947203200000000000":-2.69652057},"C":{"946857600000000000":1.81021139,"946944000000000000":-0.03202878,"947030400000000000":1.629455,"947116800000000000":0.33192641,"947203200000000000":1.28163262},"D":{"946857600000000000":-0.17251653,"946944000000000000":-0.17581665,"947030400000000000":-1.31506612,"947116800000000000":-0.27885413,"947203200000000000":0.34703478},"date":{"946857600000000000":694722092120000000,"946944000000000000":694722092120000000,"947030400000000000":694722092120000000,"947116800000000000":1356998400000000000,"947203200000000000":694722092120000000},"modified":{"946857600000000000":694722092120000000,"946944000000000000":null,"947030400000000000":694722092120000000,"947116800000000000":1356998400000000000,"947203200000000000":694722092120000000}} \ No newline at end of file +{"A":{"946857600000000000":1.56808523,"946944000000000000":-0.2550111,"947030400000000000":1.51493992,"947116800000000000":-0.02765498,"947203200000000000":0.05951614},"B":{"946857600000000000":0.65727391,"946944000000000000":-0.08072427,"947030400000000000":0.11805825,"947116800000000000":0.44679743,"947203200000000000":-2.69652057},"C":{"946857600000000000":1.81021139,"946944000000000000":-0.03202878,"947030400000000000":1.629455,"947116800000000000":0.33192641,"947203200000000000":1.28163262},"D":{"946857600000000000":-0.17251653,"946944000000000000":-0.17581665,"947030400000000000":-1.31506612,"947116800000000000":-0.27885413,"947203200000000000":0.34703478},"date":{"946857600000000000":694722092120000000,"946944000000000000":694722092120000000,"947030400000000000":694722092120000000,"947116800000000000":1356998400000000000,"947203200000000000":694722092120000000},"modified":{"946857600000000000":694722092120000000,"946944000000000000":null,"947030400000000000":694722092120000000,"947116800000000000":1356998400000000000,"947203200000000000":694722092120000000}} diff --git a/requirements-dev.txt b/requirements-dev.txt index 8f3dd20f309aa..e6346e6c38694 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -79,4 +79,4 @@ tabulate>=0.8.3 natsort git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master git+https://github.com/numpy/numpydoc -pyflakes>=2.2.0 \ No newline at end of file +pyflakes>=2.2.0 diff --git a/scripts/generate_pip_deps_from_conda.py b/scripts/generate_pip_deps_from_conda.py index c417f58f6bf1b..c6d00eb58a969 100755 --- a/scripts/generate_pip_deps_from_conda.py +++ b/scripts/generate_pip_deps_from_conda.py @@ -94,7 +94,7 @@ def main(conda_fname, pip_fname, compare=False): f"# This file is auto-generated from {fname}, do not modify.\n" "# See that file for comments about the need/usage of each dependency.\n\n" ) - pip_content = header + "\n".join(pip_deps) + pip_content = header + "\n".join(pip_deps) + "\n" if compare: with open(pip_fname) as pip_fd: diff --git a/setup.cfg b/setup.cfg index 4c6c7f6d9598c..dd60fffca050b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -288,4 +288,3 @@ check_untyped_defs=False [mypy-pandas.util._decorators] check_untyped_defs=False - diff --git a/web/pandas/community/coc.md b/web/pandas/community/coc.md index d2af9c3fdd25b..f6d0c3543840e 100644 --- a/web/pandas/community/coc.md +++ b/web/pandas/community/coc.md @@ -63,4 +63,3 @@ and the [Swift Code of Conduct][swift]. [homepage]: https://www.contributor-covenant.org [version]: https://www.contributor-covenant.org/version/1/3/0/ [swift]: https://swift.org/community/#code-of-conduct -