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

Consider adding more patterns to files.exclude #21374

Closed
pamelafox opened this issue May 4, 2023 · 11 comments
Closed

Consider adding more patterns to files.exclude #21374

pamelafox opened this issue May 4, 2023 · 11 comments
Assignees
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded

Comments

@pamelafox
Copy link
Member

I find that I've been modifying files.exclude in my dev containers recently to exclude
ruff_cache, .coverage, pytest_cache, and .pyc files

I am wondering if you'd consider adding them to the default files.exclude, or if there's any other easy way for Python devs to easily exclude them (without having to learn glob syntax, which I must admit, I still haven't truly learnt).

@lramos15
Copy link
Member

lramos15 commented May 9, 2023

Maybe this is something the python extension wants to introduce, cc @brettcannon @isidorn .

No plans currently to add any to the core defaults.

@lramos15 lramos15 assigned brettcannon and isidorn and unassigned lramos15 May 9, 2023
@isidorn
Copy link

isidorn commented May 9, 2023

We could at least add this to the Python Profiles @luabud

@luabud
Copy link
Member

luabud commented May 9, 2023

Agree with adding it to the Python profile.
@brettcannon somewhat inspired by https://github.com/github/gitignore/blob/main/Python.gitignore, I wonder if it'd make sense to add these to files.exclude in our Python profile?

__pycache__/
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
.mypy_cache/
.ruff_cache/

@brettcannon
Copy link
Member

It's seems rather broad (i.e., I don't know if all of those coverage-related ones are used by coverage.py), but otherwise the list seems reasonable.

@pamelafox
Copy link
Member Author

I'm not sure I'd stick coverage.xml in there- even though I do typically gitignore it, I sometimes look at it (being an XML file, it's grokkable). I looked at one just last week. And if htmlcov is the HTML report, I'd also leave that off.

@luabud
Copy link
Member

luabud commented May 9, 2023

Noted. How about

__pycache__/
.tox/
.nox/
.coverage
.coverage.*
.cache
.hypothesis/
.pytest_cache/
.mypy_cache/
.ruff_cache/

@pamelafox
Copy link
Member Author

That looks good, yes, assuming that .tox and .nox are correct, I haven't used those tools myself.

I just double checked .hypothesis/ and it doesn't look like a directory a human would want to peruse:

(.venv) hypothesis-test % ls .hypothesis 
examples	unicode_data
(.venv) hypothesis-test % ls .hypothesis/examples 
0dc35b04ae5fe0c5	3c054902db8ac259	40314c85a74cc041	9f95b08733d63e1e
(.venv) hypothesis-test % ls .hypothesis/unicode_data 
14.0.0
(.venv) hypothesis-test % ls .hypothesis/unicode_data/14.0.0 
charmap.json.gz
(.venv) hypothesis-test % ls .hypothesis/examples           
0dc35b04ae5fe0c5	3c054902db8ac259	40314c85a74cc041	9f95b08733d63e1e
(.venv) hypothesis-test % ls .hypothesis/examples/0dc35b04ae5fe0c5 
68e09c5bfbe3cdbe	bec021b4f368e306

(With each of the leaf files being binary data, not human readable)

So if you feel good about .tox/.nox, I think it's a good list.

@brettcannon
Copy link
Member

assuming that .tox and .nox are correct, I haven't used those tools myself.

I can confirm both are correct for those tools.

@brettcannon
Copy link
Member

Should I just transfer this issue over to the Python extension at this point if there's not going to be any updates on the core side?

@isidorn
Copy link

isidorn commented Jun 5, 2023

Yes, I think that makes most sense. Thanks Brett!

@brettcannon brettcannon transferred this issue from microsoft/vscode Jun 6, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jun 6, 2023
@luabud luabud removed the triage-needed Needs assignment to the proper sub-team label Sep 8, 2023
@luabud luabud added this to the September 2023 milestone Sep 8, 2023
@luabud luabud added feature-request Request for new features or functionality area-editor-* User-facing catch-all needs PR Ready to be worked on labels Sep 8, 2023
@luabud
Copy link
Member

luabud commented Sep 8, 2023

This has been done last month and should be included in the default Python profile in VS Code. To verify, click on the gear icon > Profiles > Import Profile... > Python > Create, and then gear icon > Profiles > Show Profiles Content... and open the settings.json file:

image

@luabud luabud closed this as completed Sep 8, 2023
@github-actions github-actions bot removed the needs PR Ready to be worked on label Sep 8, 2023
@luabud luabud added the verification-needed Verification of issue is requested label Sep 25, 2023
@Tyriar Tyriar added the verified Verification succeeded label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants