Skip to content

Prevent non-source files from being added into source-only directories #118189

Closed as not planned

Description

@arhadthedev

Feature or enhancement

Proposal:

gh-118159 accidentally added Include/incl.tar with a full copy of Include. Since this addition fell through the cracks, we need to help both contributors and triagers by .gitignore-ing non-source files in the most edited directories:

  • anything different from *.h in Include
  • anything different from *.py in Lib (except Lib/test where code is bundled with test data)

Modules and Objects require more complex rules so I skipped them. However, it'll be great if anyone defines and adds them.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. JelleZijlstra commented on Apr 23, 2024

    @JelleZijlstra
    Member

    I don't think it's worth adding automated rules here. Adding such rules has a cost in that it can cause confusion when a future change relies on adding files that don't match the pattern we expect. And the benefit is low because it's rare that we accidentally add files and if we do, we can easily fix the mistake later.

  2. added a commit that references this issue on Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixestype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions