Skip to content

ansible-lint cluttering workspace with .ansible folders #4533

@fbermel

Description

@fbermel
Summary

Installaing the latest version of ansible lint with pip install ansible-dev-tools leads to ansible-lint creating .ansible folders relative to the path where it was launched from.

Issue Type
  • Bug Report
OS / ENVIRONMENT
> ansible-lint --version
ansible-lint 25.1.3 using ansible-core:2.18.2 ansible-compat:25.1.3 ruamel-yaml:0.18.10 ruamel-yaml-clib:None
> uname -a
23.6.0 Darwin Kernel Version 23.6.0: Thu Dec 19 20:47:53 PST 2024; root:xnu-10063.141.1.703.2~1/RELEASE_ARM64_T6030 arm64
> sw_vers
ProductName:            macOS
ProductVersion:         14.7.4
BuildVersion:           23H42
  • ansible installation method: pip
  • ansible-lint installation method: pip
STEPS TO REPRODUCE
> cd ~/git/bml/infra_reloaded/
> ls
.git             .gitignore       .password        ansible.cfg      inventory        plays            requirements.txt requirements.yml roles 
> python -m venv .venv
> . .venv/bin/activate
> pip install --no-cache --quiet ansible-dev-tools

[notice] A new release of pip is available: 24.2 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
> ls .ansible
ls: .ansible: No such file or directory
> ansible-lint --version
ansible-lint 25.1.3 using ansible-core:2.18.2 ansible-compat:25.1.3 ruamel-yaml:0.18.10 ruamel-yaml-clib:None
> ls .ansible
.lock       collections roles
Desired Behavior

ansible-lint should not create .ansible folders in the directory it's launched from.

Actual Behavior

ansible-lint creates a .ansible folder even if it's just ran with the --version flag (Also see "STEPS TO REPRODUCE")

> ls .ansible
ls: .ansible: No such file or directory
> ansible-lint --version
ansible-lint 25.1.3 using ansible-core:2.18.2 ansible-compat:25.1.3 ruamel-yaml:0.18.10 ruamel-yaml-clib:None
> ls .ansible
.lock       collections roles

This is especially annoying when using it for linting inside an editor like neovim because it pollutes the workspace with these directories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions