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

Issue with command line arguments #23

Open
jdkandersson opened this issue Nov 27, 2022 · 1 comment
Open

Issue with command line arguments #23

jdkandersson opened this issue Nov 27, 2022 · 1 comment

Comments

@jdkandersson
Copy link

Not sure if this is the right place to put this, although limiting the version of pyproject-flake8<6.0.0 did resolve the issue. There seems to be a problem with the command line argument type beying passed as an str rather than a function which is resulting in the error below. I put a print statement with the arguments being passed just before this line: .tox/lint/lib/python3.10/site-packages/flake8/options/manager.py", line 274, in add_option

['--copyright-min-file-size']
{'action': 'store', 'default': 0, 'type': 'int', 'help': 'Minimum number of characters in a file before requiring a copyright notice.'}
Traceback (most recent call last):
  File ".tox/lint/bin/pflake8", line 8, in <module>
    sys.exit(main())
  File ".tox/lint/lib/python3.10/site-packages/flake8/main/cli.py", line 23, in main
    app.run(argv)
  File ".tox/lint/lib/python3.10/site-packages/flake8/main/application.py", line 198, in run
    self._run(argv)
  File ".tox/lint/lib/python3.10/site-packages/flake8/main/application.py", line 186, in _run
    self.initialize(argv)
  File ".tox/lint/lib/python3.10/site-packages/flake8/main/application.py", line 165, in initialize
    self.plugins, self.options = parse_args(argv)
  File ".tox/lint/lib/python3.10/site-packages/flake8/options/parse_args.py", line 51, in parse_args
    option_manager.register_plugins(plugins)
  File ".tox/lint/lib/python3.10/site-packages/flake8/options/manager.py", line 250, in register_plugins
    add_options(self)
  File ".tox/lint/lib/python3.10/site-packages/flake8_copyright.py", line 56, in add_options
    register_opt(
  File ".tox/lint/lib/python3.10/site-packages/flake8_copyright.py", line 30, in register_opt
    parser.add_option(*args, **kwargs)
  File ".tox/lint/lib/python3.10/site-packages/flake8/options/manager.py", line 274, in add_option
    self._current_group.add_argument(*option_args, **option_kwargs)
  File "/usr/lib/python3.10/argparse.py", line 1440, in add_argument
    raise ValueError('%r is not callable' % (type_func,))
ValueError: 'int' is not callable
@csachs
Copy link
Owner

csachs commented Nov 28, 2022

Checking this briefly it seems that this bug is related to flake8-copyright's interaction with flake8. It is reported in their repo as well savoirfairelinux/flake8-copyright#19, with a PR fix pending savoirfairelinux/flake8-copyright#20 .

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