Ignore certain lint errors ?

939 views
Skip to first unread message

bruce...@gmail.com

unread,
Nov 7, 2017, 3:42:34 AM11/7/17
to molecule-users
Hi there

I know this is probably bad practice but I would like to know if it's possible to ignore certain lint errors:

Something like : 

```yaml

verifier:
name: testinfra
enabled: true
lint:
name: flake8
ignore:
- I002
```

Werner Dijkerman

unread,
Nov 13, 2017, 1:07:12 PM11/13/17
to molecule-users
Hi,

I have an setup.cfg in the root of my git repository:

[flake8]
max-line-length = 160

Not really the same, but I believe you can add an ignore as well.


Op dinsdag 7 november 2017 09:42:34 UTC+1 schreef bruce...@gmail.com:

herve...@gmail.com

unread,
Jul 4, 2018, 3:09:56 AM7/4/18
to molecule-users
Hi,

That should be done in your playbook.

I did it with
```yaml
- name: this would typically fire GitHasVersionRule
  git: src=/path/to/git/repo dest=checkout 
  tags:
  - skip_ansible_lint
```

richard...@gmail.com

unread,
Apr 17, 2019, 4:28:14 AM4/17/19
to molecule-users

```yaml

verifier:       
  name: testinfra
  lint:         
    name: flake8
    options:    
      benchmark: true
      ignore: "E501"

Raul Cuza

unread,
Apr 17, 2019, 9:38:42 AM4/17/19
to richard...@gmail.com, molecule-users
See https://github.com/ansible/molecule/blob/6996c6053222b5bdba8f9827739c1e54b2c9bc9b/molecule/provisioner/lint/ansible_lint.py#L52
for Ansible Lint example.

See https://github.com/ansible/molecule/blob/e464e0c8d2266c27e718bc692e893be1fd7d40f6/molecule/verifier/lint/flake8.py#L68
for flake8 and https://github.com/pycqa/flake8/blob/master/docs/source/release-notes/2.1.0.rst
to learn that FLAKE8_IGNORE is the environment variable that needs to
be set.

See https://github.com/ansible/molecule/blob/7ad1cf71aef05a87dbb8361908f14c801f9e5591/molecule/lint/yamllint.py#L70
for yamllint and I can't seem to find if environment variables are
supported. A quick look at
https://github.com/adrienverge/yamllint/blob/master/yamllint/config.py
and https://github.com/adrienverge/yamllint/search?q=os.environ&unscoped_q=os.environ
would seem to say it does not. And
https://yamllint.readthedocs.io/en/stable/configuration.html also does
not mention environment variables.

Raúl
> --
> You received this message because you are subscribed to the Google Groups "molecule-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to molecule-user...@googlegroups.com.
> To post to this group, send email to molecul...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/molecule-users/b6a85dfd-6231-4fd8-80b4-8b9bc4db1b11%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages