SciTools / iris

A powerful, format-agnostic, and community-driven Python package for analysing and visualising Earth science data
https://scitools-iris.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
625 stars 282 forks source link

pep8 to pycodestyle #2941

Closed bjlittle closed 5 years ago

bjlittle commented 6 years ago

We should be moving from using pep8 to pycodestyle.

See pycodestyle PR 466 for the discussion outcome.

pelson commented 6 years ago

Agreed.

pp-mo commented 6 years ago

Why not flake8 as for Cartopy (cf https://github.com/SciTools/cartopy/pull/970) ?

mo-g commented 6 years ago

@pp-mo Consistency is good! Based on your Cartopy ref, I assume the intent would be to fix all presented errors in the PR that adds it, (fix to clean build, in other words)?

Possibly a big job! (It's been ages since I ran flake8 on Iris, and my conda environment is still downloading.) I assume you would plan for that to be Master, rather than 2.0.x?

Edit: Current Flake8 wraps pycodestyle anyway, right? So technically this would also fulfill the original issue to the letter! :wink:

pelson commented 6 years ago

I assume the intent would be to fix all presented errors in the PR that adds it

I'd start by building up a list of the files to ignore, and then once merged add PRs gradually to remove the ignore files from the list (and thereby fixing those files).

I assume you would plan for that to be Master

yep.

Current Flake8 wraps pycodestyle anyway, right?

The docs state so, yep: https://pycodestyle.readthedocs.io/en/latest/intro.html#related-tools I don't buy-in to the consistency argument. Flake8 might turn out to be the more desirable change long-term (I don't know!) but short-term, simply moving from pep8 to pycodestyle would be a win. That said, if the jump to flake8 really is easier, then go for it! Easy is good 😄

One argument for consistency is that you can copy what cartopy did. We can also readily enable stickler on this repo (as we do for cartopy).

https://github.com/SciTools/iris/pull/2896 and https://github.com/SciTools/iris/issues/2334 relate.

my conda environment is still downloading

😄

Great to hear from you btw 🎉

mo-g commented 6 years ago

You too! :penguin:

Now downloading the source, as well. ;)

The ignore list makes more sense from a KISS perspective. Thanks for the Cartopy references!

Will look at both.

mo-g commented 6 years ago

Taking the world's laziest approach:

I used the same ignores as on the Cartopy Flake8 config, and this was the output:

docs/iris/example_code/Meteorology/COP_maps.py
docs/iris/example_code/Meteorology/wind_speed.py
docs/iris/src/conf.py
docs/iris/src/developers_guide/gitwash_dumper.py
docs/iris/src/sphinxext/custom_class_autodoc.py
docs/iris/src/sphinxext/custom_data_autodoc.py
docs/iris/src/sphinxext/gen_gallery.py
docs/iris/src/sphinxext/generate_package_rst.py
lib/iris/_data_manager.py
lib/iris/_deprecation.py
lib/iris/_lazy_data.py
lib/iris/_merge.py
lib/iris/coord_systems.py
lib/iris/coords.py
lib/iris/cube.py
lib/iris/iterate.py
lib/iris/plot.py
lib/iris/util.py
lib/iris/analysis/__init__.py
lib/iris/analysis/_regrid.py
lib/iris/analysis/calculus.py
lib/iris/experimental/regrid.py
lib/iris/tests/__init__.py
lib/iris/tests/idiff.py
lib/iris/tests/pp.py
lib/iris/tests/stock.py
lib/iris/tests/system_test.py
lib/iris/tests/test_aggregate_by.py
lib/iris/tests/test_analysis.py
lib/iris/tests/test_analysis_calculus.py
lib/iris/tests/test_basic_maths.py
lib/iris/tests/test_cartography.py
lib/iris/tests/test_cdm.py
lib/iris/tests/test_cell.py
lib/iris/tests/test_cf.py
lib/iris/tests/test_constraints.py
lib/iris/tests/test_coord_api.py
lib/iris/tests/test_coord_categorisation.py
lib/iris/tests/test_coordsystem.py
lib/iris/tests/test_cube_to_pp.py
lib/iris/tests/test_ff.py
lib/iris/tests/test_file_load.py
lib/iris/tests/test_file_save.py
lib/iris/tests/test_grib_load_translations.py
lib/iris/tests/test_grib_save.py
lib/iris/tests/test_grib_save_rules.py
lib/iris/tests/test_hybrid.py
lib/iris/tests/test_image_json.py
lib/iris/tests/test_intersect.py
lib/iris/tests/test_io_init.py
lib/iris/tests/test_iterate.py
lib/iris/tests/test_load.py
lib/iris/tests/test_merge.py
lib/iris/tests/test_netcdf.py
lib/iris/tests/test_pandas.py
lib/iris/tests/test_pickling.py
lib/iris/tests/test_plot.py
lib/iris/tests/test_pp_cf.py
lib/iris/tests/test_pp_module.py
lib/iris/tests/test_pp_stash.py
lib/iris/tests/test_pp_to_cube.py
lib/iris/tests/test_quickplot.py
lib/iris/tests/test_std_names.py
lib/iris/tests/test_unit.py
lib/iris/tests/test_uri_callback.py
lib/iris/tests/test_util.py
lib/iris/tests/unit/coord_systems/test_RotatedPole.py
lib/iris/tests/unit/coord_systems/test_VerticalPerspective.py
lib/iris/tests/unit/lazy_data/test_as_concrete_data.py
lib/iris/tests/unit/plot/test__fixup_dates.py
lib/iris/tests/unit/plot/test_plot.py
lib/iris/tests/unit/coords/__init__.py
lib/iris/tests/unit/coords/test_Cell.py
lib/iris/tests/unit/coords/test_DimCoord.py
lib/iris/tests/unit/analysis/test_WPERCENTILE.py
lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py
lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py
lib/iris/tests/unit/analysis/maths/__init__.py
lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py
lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py
lib/iris/tests/unit/analysis/cartography/test__xy_range.py
lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py
lib/iris/tests/unit/analysis/stats/test_pearsonr.py
lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py
lib/iris/tests/unit/experimental/regrid/test__CurvilinearRegridder.py
lib/iris/tests/unit/experimental/stratify/test_relevel.py
lib/iris/tests/unit/experimental/um/test_FieldsFileVariant.py
lib/iris/tests/unit/concatenate/test__CubeSignature.py
lib/iris/tests/unit/concatenate/test_concatenate.py
lib/iris/tests/unit/cube/test_Cube.py
lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py
lib/iris/tests/unit/util/test__coord_regular.py
lib/iris/tests/unit/time/test_PartialDateTime.py
lib/iris/tests/unit/fileformats/ff/test_FF2PP.py
lib/iris/tests/unit/fileformats/ff/test_Grid.py
lib/iris/tests/unit/fileformats/pp/test_PPField.py
lib/iris/tests/unit/fileformats/pp/test_as_fields.py
lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py
lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py
lib/iris/tests/unit/fileformats/cf/test_CFReader.py
lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_auxiliary_coordinate.py
lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_mercator_coordinate_system.py
lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_stereographic_coordinate_system.py
lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py
lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py
lib/iris/tests/unit/fileformats/netcdf/test_Saver.py
lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py
lib/iris/tests/unit/fileformats/netcdf/test_parse_cell_methods.py
lib/iris/tests/unit/fileformats/netcdf/test_save.py
lib/iris/tests/unit/fileformats/um/fast_load/test__convert_collation.py
lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_group_structured_fields.py
lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py
lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py
lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py
lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py
lib/iris/tests/integration/test_FieldsFileVariant.py
lib/iris/tests/integration/test_grib2.py
lib/iris/tests/integration/test_netcdf.py
lib/iris/tests/integration/test_pickle.py
lib/iris/tests/integration/test_pp.py
lib/iris/tests/integration/test_regrid_equivalence.py
lib/iris/tests/integration/test_regridding.py
lib/iris/tests/integration/test_subset.py
lib/iris/tests/integration/plot/test_colorbar.py
lib/iris/tests/integration/plot/test_netcdftime.py
lib/iris/tests/integration/plot/test_nzdateline.py
lib/iris/tests/integration/fast_load/test_fast_load.py
lib/iris/tests/integration/format_interop/test_name_grib.py
lib/iris/tests/experimental/test_raster.py
lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py
lib/iris/tests/runner/_runner.py
lib/iris/io/__init__.py
lib/iris/io/format_picker.py
lib/iris/fileformats/_ff.py
lib/iris/fileformats/_pp_lbproc_pairs.py
lib/iris/fileformats/abf.py
lib/iris/fileformats/cf.py
lib/iris/fileformats/dot.py
lib/iris/fileformats/name_loaders.py
lib/iris/fileformats/netcdf.py
lib/iris/fileformats/pp.py
lib/iris/fileformats/pp_load_rules.py
lib/iris/fileformats/pp_save_rules.py
lib/iris/fileformats/rules.py
lib/iris/fileformats/um_cf_map.py
lib/iris/fileformats/um/_fast_load.py
lib/iris/fileformats/um/_ff_replacement.py
lib/iris/fileformats/um/_optimal_array_structuring.py
requirements/gen_conda_requirements.py
setup.py
tools/gen_stash_refs.py
tools/gen_translations.py
tools/generate_std_names.py
tools/translator/__init__.py
mo-g commented 6 years ago

And in interesting data... I pulled pyflakes and pycodestyle from Conda, I figured it would be fresher than Mint's. I assumed that flake8 would include all pycodestyle matches, and add some more. But there are some that pycodestyle picks up and flake8 doesn't - as well as vice versa. Need to work out why that is!

F: docs/iris/src/sphinxext/generate_package_rst.py
F: docs/iris/src/sphinxext/custom_class_autodoc.py
F: docs/iris/src/sphinxext/custom_data_autodoc.py
F: lib/iris/plot.py
F: lib/iris/coords.py
F: lib/iris/_merge.py
F: lib/iris/_lazy_data.py
F: lib/iris/iterate.py
F: lib/iris/_deprecation.py
F: lib/iris/util.py
F: lib/iris/_data_manager.py
F: lib/iris/coord_systems.py
F: lib/iris/analysis/calculus.py
F: lib/iris/analysis/_regrid.py
F: lib/iris/analysis/trajectory.py
F: lib/iris/tests/test_pandas.py
F: lib/iris/tests/test_grib_load_translations.py
F: lib/iris/tests/test_plot.py
F: lib/iris/tests/test_ff.py
F: lib/iris/tests/test_image_json.py
F: lib/iris/tests/test_netcdf.py
F: lib/iris/tests/unit/lazy_data/test_as_concrete_data.py
F: lib/iris/tests/unit/plot/test__fixup_dates.py
F: lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py
F: lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py
F: lib/iris/tests/unit/analysis/maths/__init__.py
F: lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py
F: lib/iris/tests/unit/analysis/cartography/test__xy_range.py
F: lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py
F: lib/iris/tests/unit/experimental/stratify/test_relevel.py
F: lib/iris/tests/unit/experimental/um/test_FieldsFileVariant.py
F: lib/iris/tests/unit/concatenate/test_concatenate.py
F: lib/iris/tests/unit/concatenate/test__CubeSignature.py
F: lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py
F: lib/iris/tests/unit/util/test__coord_regular.py
F: lib/iris/tests/unit/time/test_PartialDateTime.py
F: lib/iris/tests/unit/fileformats/ff/test_FF2PP.py
F: lib/iris/tests/unit/fileformats/ff/test_Grid.py
F: lib/iris/tests/unit/fileformats/pp/test_as_fields.py
F: lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py
F: lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py
F: lib/iris/tests/unit/fileformats/cf/test_CFReader.py
F: lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_auxiliary_coordinate.py
F: lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_mercator_coordinate_system.py
F: lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_stereographic_coordinate_system.py
F: lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py
F: lib/iris/tests/unit/fileformats/netcdf/test_save.py
F: lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py
F: lib/iris/tests/unit/fileformats/netcdf/test_Saver.py
F: lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py
F: lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py
F: lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py
F: lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py
F: lib/iris/tests/integration/test_regridding.py
F: lib/iris/tests/integration/test_regrid_equivalence.py
F: lib/iris/tests/integration/test_subset.py
F: lib/iris/tests/integration/test_pickle.py
F: lib/iris/tests/integration/test_FieldsFileVariant.py
F: lib/iris/tests/integration/test_netcdf.py
F: lib/iris/tests/integration/plot/test_nzdateline.py
F: lib/iris/tests/integration/plot/test_netcdftime.py
F: lib/iris/tests/integration/plot/test_colorbar.py
F: lib/iris/tests/integration/format_interop/test_name_grib.py
F: lib/iris/tests/experimental/test_raster.py
F: lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py
F: lib/iris/tests/runner/_runner.py
F: lib/iris/fileformats/pp_save_rules.py
F: lib/iris/fileformats/_pp_lbproc_pairs.py
F: lib/iris/fileformats/name_loaders.py
F: lib/iris/fileformats/netcdf.py
F: lib/iris/fileformats/um/_ff_replacement.py
F: lib/iris/fileformats/um/_fast_load.py
F: lib/iris/fileformats/um/_optimal_array_structuring.py
F: tools/translator/__init__.py
P lib/iris/tests/__init__.py
P lib/iris/tests/pp.py
P lib/iris/tests/stock.py
P lib/iris/tests/system_test.py
P lib/iris/tests/test_analysis.py
P lib/iris/tests/test_analysis_calculus.py
P lib/iris/tests/test_basic_maths.py
P lib/iris/tests/test_cartography.py
P lib/iris/tests/test_cdm.py
P lib/iris/tests/test_cell.py
P lib/iris/tests/test_cf.py
P lib/iris/tests/test_constraints.py
P lib/iris/tests/test_coord_api.py
P lib/iris/tests/test_coord_categorisation.py
P lib/iris/tests/test_coordsystem.py
P lib/iris/tests/test_cube_to_pp.py
P lib/iris/tests/test_file_load.py
P lib/iris/tests/test_file_save.py
P lib/iris/tests/test_grib_save.py
P lib/iris/tests/test_grib_save_rules.py
P lib/iris/tests/test_hybrid.py
P lib/iris/tests/test_intersect.py
P lib/iris/tests/test_io_init.py
P lib/iris/tests/test_iterate.py
P lib/iris/tests/test_load.py
P lib/iris/tests/test_merge.py
P lib/iris/tests/test_pp_cf.py
P lib/iris/tests/test_pp_module.py
P lib/iris/tests/test_pp_stash.py
P lib/iris/tests/test_pp_to_cube.py
P lib/iris/tests/test_quickplot.py
P lib/iris/tests/test_std_names.py
P lib/iris/tests/test_unit.py
P lib/iris/tests/test_uri_callback.py
P lib/iris/tests/test_util.py
P lib/iris/io/__init__.py
P lib/iris/io/format_picker.py
P lib/iris/fileformats/cf.py
P lib/iris/fileformats/dot.py
P lib/iris/fileformats/pp_load_rules.py
P lib/iris/fileformats/rules.py
P lib/iris/fileformats/um_cf_map.py

F for flake, P for pycs.

pp-mo commented 6 years ago

some that pycodestyle picks up and flake8 doesn't - as well as vice versa

Hmm. That didn't happen in Cartopy IIRC. Check versions ?

HIi @mo-g ! 😉

mo-g commented 6 years ago

which tells me I'm using the conda flake8, which itself reports that it's using pycodestyle. My system copy is still 'pep8'.

Hi @pp-mo ! :penguin:

So far I've been running both in quiet mode just to get filename lists, since I didn't trust that this wouldn't happen. ;)

I'll try running them 'normally' on a couple of test files and compare output.

mo-g commented 6 years ago

Ok, here we go:

(iris) zzz@glados ~/src/iris/lib/iris/tests $ flake8 test_basic_maths.py 
(iris) zzz@glados ~/src/iris/lib/iris/tests $ pycodestyle test_basic_maths.py 
test_basic_maths.py:21:80: E501 line too long (95 > 79 characters)
test_basic_maths.py:97:80: E501 line too long (87 > 79 characters)
test_basic_maths.py:105:80: E501 line too long (105 > 79 characters)
test_basic_maths.py:116:80: E501 line too long (81 > 79 characters)
test_basic_maths.py:189:80: E501 line too long (90 > 79 characters)
test_basic_maths.py:203:80: E501 line too long (85 > 79 characters)
test_basic_maths.py:204:80: E501 line too long (106 > 79 characters)
test_basic_maths.py:233:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:234:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:239:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:240:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:257:80: E501 line too long (80 > 79 characters)
test_basic_maths.py:260:80: E501 line too long (83 > 79 characters)
test_basic_maths.py:263:80: E501 line too long (83 > 79 characters)
test_basic_maths.py:269:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:270:20: E124 closing bracket does not match visual indentation
test_basic_maths.py:288:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:310:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:311:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:312:20: E124 closing bracket does not match visual indentation
test_basic_maths.py:318:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:319:20: E124 closing bracket does not match visual indentation
test_basic_maths.py:327:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:403:80: E501 line too long (80 > 79 characters)
test_basic_maths.py:438:80: E501 line too long (86 > 79 characters)
test_basic_maths.py:444:80: E501 line too long (110 > 79 characters)
test_basic_maths.py:472:80: E501 line too long (90 > 79 characters)
test_basic_maths.py:540:17: E128 continuation line under-indented for visual indent
test_basic_maths.py:571:17: E128 continuation line under-indented for visual indent
test_basic_maths.py:586:60: W291 trailing whitespace
test_basic_maths.py:587:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:587:28: E231 missing whitespace after ','
test_basic_maths.py:590:16: E201 whitespace after '('
test_basic_maths.py:590:38: E202 whitespace before ')'
test_basic_maths.py:595:28: E201 whitespace after '('
test_basic_maths.py:595:50: E202 whitespace before ')'
test_basic_maths.py:597:78: E231 missing whitespace after ','
test_basic_maths.py:597:80: E501 line too long (95 > 79 characters)
test_basic_maths.py:603:20: E128 continuation line under-indented for visual indent
test_basic_maths.py:604:20: E124 closing bracket does not match visual indentation
test_basic_maths.py:608:37: W291 trailing whitespace
(iris) zzz@glados ~/src/iris/lib/iris/tests $ flake8 test_netcdf.py 
test_netcdf.py:84:13: F841 local variable 'cube' is assigned to but never used
test_netcdf.py:174:13: F841 local variable 'cube' is assigned to but never used
(iris) zzz@glados ~/src/iris/lib/iris/tests $ pycodestyle test_netcdf.py 
(iris) zzz@glados ~/src/iris/lib/iris/tests $ 

Can confirm line 21 of test_basic_maths is in fact too long. Why isn't flake8 upset!? Tried upping the verbosity, and nothing jumps out...

Can anyone else pull flake8 and pycodestyle into an environment, and verify my result?

(iris) zzz@glados ~/src/iris/lib/iris/tests $ flake8 test_basic_maths.py -v
flake8.plugins.manager    MainProcess     39 INFO     Loading entry-points for "flake8.extension".
flake8.plugins.manager    MainProcess     42 INFO     Loading entry-points for "flake8.listen".
flake8.plugins.manager    MainProcess     42 INFO     Loading entry-points for "flake8.report".
flake8.plugins.manager    MainProcess     43 INFO     Loading plugin "C90" from entry-point.
flake8.plugins.manager    MainProcess     46 INFO     Loading plugin "pycodestyle.comparison_type" from entry-point.
flake8.plugins.manager    MainProcess     53 INFO     Loading plugin "pycodestyle.missing_whitespace_after_import_keyword" from entry-point.
flake8.plugins.manager    MainProcess     54 INFO     Loading plugin "pycodestyle.imports_on_separate_lines" from entry-point.
flake8.plugins.manager    MainProcess     54 INFO     Loading plugin "pycodestyle.continued_indentation" from entry-point.
flake8.plugins.manager    MainProcess     54 INFO     Loading plugin "pycodestyle.maximum_line_length" from entry-point.
flake8.plugins.manager    MainProcess     54 INFO     Loading plugin "pycodestyle.bare_except" from entry-point.
flake8.plugins.manager    MainProcess     54 INFO     Loading plugin "pycodestyle.ambiguous_identifier" from entry-point.
flake8.plugins.manager    MainProcess     54 INFO     Loading plugin "pycodestyle.python_3000_not_equal" from entry-point.
flake8.plugins.manager    MainProcess     54 INFO     Loading plugin "pycodestyle.trailing_whitespace" from entry-point.
flake8.plugins.manager    MainProcess     54 INFO     Loading plugin "F" from entry-point.
flake8.plugins.manager    MainProcess     64 INFO     Loading plugin "pycodestyle.whitespace_around_operator" from entry-point.
flake8.plugins.manager    MainProcess     64 INFO     Loading plugin "pycodestyle.python_3000_raise_comma" from entry-point.
flake8.plugins.manager    MainProcess     65 INFO     Loading plugin "pycodestyle.comparison_negative" from entry-point.
flake8.plugins.manager    MainProcess     65 INFO     Loading plugin "pycodestyle.python_3000_has_key" from entry-point.
flake8.plugins.manager    MainProcess     65 INFO     Loading plugin "pycodestyle.blank_lines" from entry-point.
flake8.plugins.manager    MainProcess     65 INFO     Loading plugin "pycodestyle.python_3000_backticks" from entry-point.
flake8.plugins.manager    MainProcess     65 INFO     Loading plugin "pycodestyle.indentation" from entry-point.
flake8.plugins.manager    MainProcess     65 INFO     Loading plugin "pycodestyle.tabs_or_spaces" from entry-point.
flake8.plugins.manager    MainProcess     65 INFO     Loading plugin "pycodestyle.module_imports_on_top_of_file" from entry-point.
flake8.plugins.manager    MainProcess     65 INFO     Loading plugin "pycodestyle.missing_whitespace" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.whitespace_around_named_parameter_equals" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.explicit_line_join" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.whitespace_around_comma" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.whitespace_before_parameters" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.missing_whitespace_around_operator" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.compound_statements" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.trailing_blank_lines" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.extraneous_whitespace" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.whitespace_around_keywords" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.tabs_obsolete" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.break_around_binary_operator" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.whitespace_before_comment" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "pycodestyle.comparison_to_singleton" from entry-point.
flake8.plugins.manager    MainProcess     66 INFO     Loading plugin "default" from entry-point.
flake8.plugins.manager    MainProcess     67 INFO     Loading plugin "quiet-filename" from entry-point.
flake8.plugins.manager    MainProcess     67 INFO     Loading plugin "pylint" from entry-point.
flake8.plugins.manager    MainProcess     67 INFO     Loading plugin "quiet-nothing" from entry-point.
flake8.checker            MainProcess     78 INFO     Making checkers
flake8.checker            MainProcess    102 INFO     Checking 0 files
flake8.main.application   MainProcess    177 INFO     Finished running
flake8.main.application   MainProcess    178 INFO     Reporting errors
flake8.main.application   MainProcess    178 INFO     Found a total of 0 violations and reported 0
pp-mo commented 6 years ago

Can confirm line 21 of test_basic_maths is in fact too long. Why isn't flake8 upset!

I think it's because the Iris project already has a config file for flake8 ... : https://github.com/SciTools/iris/blob/master/setup.cfg This currently contains a file exclusion for test_basic_maths.

Crappy name for a config file, eh ?

pp-mo commented 6 years ago

(iris) zzz@glados ~/src/iris/lib/iris/tests $ flake8 test_netcdf.py test_netcdf.py:84:13: F841 local variable 'cube' is assigned to but never used test_netcdf.py:174:13: F841 local variable 'cube' is assigned to but never used (iris) zzz@glados ~/src/iris/lib/iris/tests $ pycodestyle test_netcdf.py (iris) zzz@glados ~/src/iris/lib/iris/tests $

This one is because those 'F' errors are from the lint-style tests of "pyflakes", not the pep8-style checks of "pycodestyle" (which are 'E' codes)

pp-mo commented 6 years ago

Crappy name for a config file, eh ?

Actually we could rename it ".flake8". I for one would merge that ...

mo-g commented 6 years ago

I think it's because the Iris project already has a config file for flake8 Yep, that fixed it.

mo-g commented 6 years ago

As requested, one very simple PR. ;)

pp-mo commented 5 years ago

We are now testing in GitHub CI, using flake8, via Stickler-CI However, it still remains to retire the section in iris.tests.test_coding_style.