Skip to content

ENH: Enhance the suggestions made by pytask clean. #146

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

Closed
tobiasraabe opened this issue Oct 29, 2021 · 3 comments · Fixed by #273
Closed

ENH: Enhance the suggestions made by pytask clean. #146

tobiasraabe opened this issue Oct 29, 2021 · 3 comments · Fixed by #273
Labels
enhancement New feature or request
Milestone

Comments

@tobiasraabe
Copy link
Member

Describe the solution you'd like

  • Add an option to ignore files which are known by git.
  • Differentiate between folder to collect from and folder to delete from.
@tobiasraabe tobiasraabe added the enhancement New feature or request label Oct 29, 2021
@axtimhaus
Copy link

An option in the config file for ignoring files would also be helpful. The current ignore option does not work with clean.

@tobiasraabe
Copy link
Member Author

Thanks for the reprot. I guess the following lines are part of the problem.

if config["command"] == "clean":
config["ignore"] = [
i for i in config["ignore"] if i not in IGNORED_TEMPORARY_FILES_AND_FOLDERS
]

@tobiasraabe
Copy link
Member Author

tobiasraabe commented May 3, 2022

How to get all files tracked by git. Burrowed from https://github.com/pre-commit/pre-commit/blob/main/pre_commit/git.py.

def zsplit(s: str) -> list[str]:
    s = s.strip('\0')
    if s:
        return s.split('\0')
    else:
        return []

def get_all_files() -> list[str]:
    return zsplit(cmd_output('git', 'ls-files', '-z')[1])


zsplit(get_all_files())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants