Takishima / flake8-secure-coding-standard

Flake8 plugin to enforce some secure coding standards for Python.
Apache License 2.0
4 stars 2 forks source link

Modes in pyproject.toml cannot be converted to octal #78

Open nkakouros opened 1 month ago

nkakouros commented 1 month ago

I use flake8 together with the flake8-pyproject plugin to be able to use a single pyproejct.toml file for all my project's needs. I have the following config snippet:

os-mkdir-mode = 493  # 0o755
os-open-mode = 493  # 0o755
os-mkfifo-mode = 416  #0o640
os-mknod-mode = 416  #0o640

This triggers an error:

  File "/.../.venv/lib/python3.12/site-packages/flake8_secure_coding_standard.py", line 712, in _set_mode_option
    setattr(Visitor, f'os_{name}_modes_msg_arg', f'mode in {[oct(mode) for mode in modes]}')
                                                             ^^^^^^^^^
TypeError: 'str' object cannot be interpreted as an integer
Takishima commented 3 weeks ago

Can you try to add your comment on a separate line?

Something like this:

# 0o755
os-mkdir-mode = 493