Skip to content

paths_to_include/exclude don't work if path ends in '/' #539

Closed
@Pennycook

Description

Describe the bug
While experimenting with the include/exclude functionality of bear for a large project, I tried a file like the following:

    "content": {
      "include_only_existing_source": true,
      "paths_to_include": ["/path/to/source/"],
      "paths_to_exclude": [],
      "duplicate_filter_fields": "file_output"
    },

This resulted in an empty configuration file. Correcting the path to "/path/to/source" worked as expected.

To Reproduce
Specify a path ending in a /.

Expected behavior
I expected these paths to work both with and without a final / character.

Environment:

  • OS name: Linux
  • OS version: Ubuntu 22.04
  • OS architecture: x86_64
  • Bear version: bear 3.1.1
  • Bear install method: from source

Additional context
We often recommend that people use Bear to generate compilation databases for use with Code Base Investigator. Limiting the compilation database to only the files that a developer is responsible for maintaining limits the amount of time Code Base Investigator needs to spend parsing code, and may result in more accurate code divergence calculations.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementnextwill work on this in the near future

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions