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

Add support for rpmlint folder in the root of inventory_dir #377

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions obal/data/playbooks/lint/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
roles:
- package_variables
tasks:

- name: 'Scans for rpmlint file'
ansible.builtin.find:
path: "{{ inventory_dir }}/rpmlint"
file_type: file
recurse: true
hidden: true
register: lintfile

- name: 'Set rpmlint file when present'
set_fact:
rpmlint_rc_file: "{{ lintfile.files | map(attribute='path') | first }}"
when: lintfile.files | map(attribute='size') | length > 0

- name: 'Set default rpmlint RC file'
set_fact:
rpmlint_rc_file: "{{ inventory_dir }}/{{ package_base_dir }}{{ inventory_hostname }}/.rpmlintrc"
Expand Down
5 changes: 5 additions & 0 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,11 @@ def test_obal_lint_hello_with_epoch():

assert_mockbin_log(["rpmlint --file {pwd}/packages/hello/.rpmlintrc {pwd}/packages/hello"])

@obal_cli_test(repotype='upstream')
def test_obal_lint_rpmlint_folder():
assert_obal_success(['lint', 'hello'])

assert_mockbin_log(["rpmlint --file {pwd}/rpmlint/.rpmlintrc {pwd}/packages/hello"])

@obal_cli_test(repotype='upstream_bad_changelog')
def test_obal_lint_bad_changelog():
Expand Down
Loading