ansible / ansible-content-parser

Apache License 2.0
3 stars 4 forks source link

Add the shorter option (-S) for --skip-ansible-lint #29

Closed TamiTakamiya closed 10 months ago

TamiTakamiya commented 10 months ago

Issue: No JIRA issue opened for this.

Description

Provide the shorter alternative option (-S) for the --skip-ansible-lint option for better usability. -s (lowercase) was not chosen because it is used as the --strict option in ansible-lint.

Testing

Run ansible-content-parser with -S option and verify the report.txt file in the output directory does not contain outputs from ansible-lint. A Unit test is also included in this PR.

Steps to test

Build & install the updated code

  1. Change to a work directory like /var/tmp
  2. Download the PR branch:
    git clone git@github.com:ansible/ansible-content-parser.git
    cd ansible-content-parser/
    git checkout 'ttakamiy/skip-ansible-lint-short-option'
  3. Make sure python3 > 3.10 and create & activate venv
    python3 -V
    python3 -m venv venv
    source venv/bin/activate
  4. Upgrade pip and install dependencies
    pip install --upgrade pip
    pip install -e '.[test]'
  5. Reactivate venv
    deactivate
    source venv/bin/activate
  6. Run tox to build installable images (it also runs unit tests)
    tox
  7. Install the .whl file built by tox
    pip install dist/ansible_content_parser-xxxxxxx-py3-none-any.whl
  8. Reactivate venv
    deactivate
    source venv/bin/activate
  9. Run ansible-content-parser with the --help option and verify the new -S option shows up
    ansible-content-parser --help
  10. Run ansible-content-parser with the -Soption against a simple sample project
    ansible-content-parser -S https://github.com/ansible/ansible-tower-samples out
  11. Check out/report.txt to verify there is no outputs from ansible-lint
    cat out/report.txt

Scenarios tested

See the "Steps to test" section.