python-security/pyt

Implement -r recursive option

KevinHock opened this issue ยท 6 comments

So let us steal, once again (a 3rd, or 4th time), from Bandit.

https://github.com/openstack/bandit/blob/master/bandit/cli/main.py#L157-L160

https://github.com/openstack/bandit/blob/8f09d8b208f037b7d49ed6bc88f2ac200e7cc06c/bandit/core/manager.py#L171-L219

This will enable a user to just give -r /path/to/files instead of -f file one at a time.

This is less straightforward, you should also add

    parser.add_argument(
        'targets', metavar='targets', type=str, nargs='*',
        help='source file(s) or directory(s) to be tested'
    )
    parser.add_argument(
        '-x', '--exclude', dest='excluded_paths', action='store',
        default='', help='comma-separated list of paths to exclude from scan '
                         '(note that these are in addition to the excluded '
                         'paths provided in the config file)'
    )

too.

This will help us out a great deal, as I'm working on documentation, and then after docs I'll return to the CFG work (the expr_star_handler stuff). So without you I wouldn't work on this for a while.

Look at the files I linked to see how all this is done.

Hi @omergunal, I have a hard ticket for you ๐Ÿ‘

All right, i'm waiting for you

Yes?

We can work on this when you finish documentation

Yay ๐ŸŽŠ ๐ŸŽ‰ ๐ŸŽˆ