Skip to content
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

Crash when using regular expressions #13

Closed
tomascapek opened this issue Aug 13, 2018 · 2 comments
Closed

Crash when using regular expressions #13

tomascapek opened this issue Aug 13, 2018 · 2 comments
Assignees

Comments

@tomascapek
Copy link

I created a simple rule from which I expected to fail on every single file in my project:

settings:
  all_files: &all_files !settings
    included:
      - ~+/*
    excluded:
      - ~+/.tox/*
    allow_ignore: yes

default_settings: *all_files

rules:
  SimpleRule:
    description: "Simple rule"
    expr: !regex .*

And then I launched it:

bellybutton lint

Which results in a crash:

Traceback (most recent call last):
  File "/home/dev_intern/.virtualenvs/bellybutton-test/bin/bellybutton", line 11, in <module>
    sys.exit(main())
  File "/home/dev_intern/.virtualenvs/bellybutton-test/lib/python3.5/site-packages/bellybutton/cli.py", line 203, in main
    for arg in args.func.__code__.co_varnames[:args.func.__code__.co_argcount]
  File "/home/dev_intern/.virtualenvs/bellybutton-test/lib/python3.5/site-packages/bellybutton/cli.py", line 167, in lint
    linting_results = list(lint_file(filepath, file_contents, rules))
  File "/home/dev_intern/.virtualenvs/bellybutton-test/lib/python3.5/site-packages/bellybutton/linting.py", line 65, in lint_file
    for match in re.finditer(rule.expr)
TypeError: finditer() missing 1 required positional argument: 'string'

Can this be fixed soon?

@hchasestevens
Copy link
Owner

Hello @tomascapek , thanks for raising this. The bug you described should now be fixed in the latest release (v.2.2). Would you mind having a look to verify? Thanks again!

@tomascapek
Copy link
Author

It works fine now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants