Giter Site home page Giter Site logo

ciocheck's People

Contributors

goanpeca avatar havocp avatar rlaverde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ciocheck's Issues

Dicts exceeding char limits are badly modified

Here's the diff:

-            return { "errors": [
-                {
-                    "detail": "HTTP 400: Bad path provided: Path %s does not exist!" % nbs_root,
-                    "title": "HTTP 400",
-                    "status": 400
-                }
-            ]}
+            return {
+                "errors": [
+                    {
+                        "detail":
+                        "HTTP 400: Bad path provided: Path %s does not exist!"
+                        % nbs_root,
+                        "title":
+                        "HTTP 400",
+                        "status":
+                        400
+                    }
+                ]
+            }

Is there a way to fix it or at least skip those specific checks? I'd rather violate line lengths in this case...

More ascii decoding errors in formatters

/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/formaters.py:43: UnicodeWarning: Unicode unequal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  changed = new_contents != old_contents
/home/circleci/miniconda/lib/python2.7/difflib.py:437: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  a[besti+bestsize] == b[bestj+bestsize]:
/home/circleci/miniconda/lib/python2.7/difflib.py:433: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  a[besti-1] == b[bestj-1]:
Traceback (most recent call last):
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/format_task.py", line 53, in <module>
    main()
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/format_task.py", line 45, in main
    task_result = format_file(filename)
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/format_task.py", line 35, in format_file
    result = formater.format_task(path)
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/formaters.py", line 54, in format_task
    'diff': diff(old_contents, new_contents),
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/utils.py", line 209, in diff
    return ''.join(result)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: ordinal not in range(128)

ascii decoding errors

Running "isort" ...
Traceback (most recent call last):
  File "/home/circleci/miniconda/bin/ciocheck", line 11, in <module>
    sys.exit(main())
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/main.py", line 389, in main
    test.run()
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/main.py", line 76, in run
    extensions=tool.extensions)
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/files.py", line 50, in get_files
    branch=branch, diff_mode=diff_mode, extensions=extensions)
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/files.py", line 65, in get_modified_file_lines
    results = self.diff_tool.commited_file_lines(branch=branch)
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/vcs.py", line 542, in commited_file_lines
    results.update(diff_tool.commited_file_lines(branch=branch))
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/vcs.py", line 423, in commited_file_lines
    result = self._parse_diff_str(self._diff_committed(branch=branch))
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/vcs.py", line 364, in _diff_committed
    branch=branch, files_only=False, mode=COMMITED_MODE)
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/vcs.py", line 151, in _git_run_helper
    result, error = run_command(command, cwd=self.path)
  File "/home/circleci/miniconda/lib/python2.7/site-packages/ciocheck/utils.py", line 100, in run_command
    output = output.decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 9777: ordinal not in range(128)
Exited with code 1

Ciocheck config

unix: cd ${PROJECT_DIR}/deploy && python -m pytest --cov=anaconda_platform.deploy --cov-report=term-missing:skip-covered --cov-report=html --cov-fail-under=100 --no-cov-on-fail --cov-config=.coveragerc anaconda_platform/deploy/tests

@goanpeca so this is essentially what I want to do with ciocheck (see also the .coveragerc in this PR). The reason ciocheck doesn't work (I think?) is that if I cd into deploy subdir as I do here, ciocheck can't find the .ciocheck in the root dir one level up. (I have .ciocheck-test which does an inherit_from .ciocheck, and I think the inherit_from looks relative to cwd not relative to ciocheck-test?). If I don't cd into the deploy subdir then the module paths are messed up which causes its own trouble.

if you want you can check this branch out and try ./apb test deploy to see what my command here does and play with using ciocheck in kapsel.yml instead..

@havocp could please add any additional context here. The initial version of ciocheck was very limited in terms of where to look for config and stuff. But if you define some "rules" that make sense to you I can make a new release in a week or so.

setup.py broken

$ pip install -e .
Obtaining file:///home/antoine/ciocheck
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/antoine/ciocheck/setup.py", line 44
        description='A stand alone PyQt/PySide GUI application for managing conda '
           ^
    SyntaxError: keyword argument repeated

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/antoine/ciocheck/

MNT: Stop using ci-helpers in appveyor.yml

To whom it may concern,

If you are using https://github.com/astropy/ci-helpers in your appveyor.yml , please know that the Astropy project has dropped active development/support for Appveyor CI. If it still works, good for you, because we did not remove the relevant files (yet). But if it ever stops working, we have no plans to fix anything for Appveyor CI. Please consider using native Windows support other CI, e.g., Travis CI (see https://docs.travis-ci.com/user/reference/windows/). We apologize for any inconvenience caused.

If this issue is opened in error or irrelevant to you, feel free to close. Thank you.

xref astropy/ci-helpers#464

pytest check fails

$ ciocheck .

================
Running ciocheck
================

Running "pyformat" ...
Running "isort" ...
Running "yapf" ...
Running "autopep8" ...
Running "Multi formatter"
Running "pydocstyle" ...
Running "flake8" ...
Running "pylint" ...
Running "coverage" ...
Running "pytest" ...
['/path/to/main.py', '/path/to/utils/concurrency.py', '/path/to/utils/messaging.py', '--json=.pytestreport.json', '-n', '4', '--cov-config', '/path/to/.coveragerc', '--cov=/path/to/.']
usage: ciocheck [options] [file_or_dir] [file_or_dir] [...]
ciocheck: error: unrecognized arguments: --json=.pytestreport.json -n 4
  inifile: /path/to/pytest.ini
  rootdir: /path/to/.

Config:

[ciocheck]
inherit_config = .ciocheck
branch = origin/master
diff_mode = commited
file_mode = lines
check = pydocstyle,flake8,pylint,pyformat,isort,autopep8,yapf,coverage,pytest
enforce = pydocstyle,flake8,pylint,pyformat,isort,autopep8,yapf,coverage,pytest

header = # -*- coding: utf-8 -*-
copyright_file = LICENSE
add_copyright = true
add_header = true
add_init = false

Ciocheck fails with unhandled JSONDecodeError

Run fails with weird decoder errors:

Traceback (most recent call last):
  File "/Users/fpliger/miniconda3/envs/fusion/bin/ciocheck", line 9, in <module>
    load_entry_point('ciocheck', 'gui_scripts', 'ciocheck')()
  File "/Users/fpliger/dev/repos/ciocheck/ciocheck/main.py", line 389, in main
    test.run()
  File "/Users/fpliger/dev/repos/ciocheck/ciocheck/main.py", line 97, in run
    multi_results = tool.run(files)
  File "/Users/fpliger/dev/repos/ciocheck/ciocheck/formatters.py", line 273, in run
    results = await_all_processes()
  File "/Users/fpliger/dev/repos/ciocheck/ciocheck/formatters.py", line 245, in await_all_processes
    output, error = await_one_process()
  File "/Users/fpliger/dev/repos/ciocheck/ciocheck/formatters.py", line 235, in await_one_process
    output = json.loads(output)
  File "/Users/fpliger/miniconda3/envs/fusion/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/Users/fpliger/miniconda3/envs/fusion/lib/python3.5/json/decoder.py", line 342, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3)

The text triggering the errors is like:

[{"yapf": {"error": null, "diff": "--- \\n+++ \\n@@ -22,6 +22,7 @@\\n from anacondafusion.core.server import FusionApp\\n \\n pemfile = os.path.join(settings.HERE, \\"assets\\", \\"fusion.pem\\")\\n+\\n \\n def get_nbs_root():\\n \'\'\'\\n", "created": false, "path": "/Users/fpliger/dev/repos/anaconda-fusion/anacondafusion/__main__.py"}}]\n\x1b[?1034h

or

[]\n\x1b[?1034h

pycodestyle

pep8 is no more. pycodestyle is its replacement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.