Skip to content

Test files are included in the output #49

@rafaelrozon

Description

@rafaelrozon

Describe the bug
I'm trying to exclude test files and other kinds of files from the output graph, but they are always present.

Describe your environment

  • Are you using the tool on macOS or linux? macOS
  • Which Python version are you using? Python 3.9.6
  • Which browser (with version) are you using? Chrome 121.0.6167.184
  • Are you scanning a public source code repository that you can provide? I tried this in a private repo and in a public repo. The results were the same. This is the public repo I used for testing: https://github.com/resend/react-email
  • If not - can you provide code snippets where or further information on the data that might be relevant for the bug?

To Reproduce
Steps to reproduce the behavior:

  1. Create a config like
project_name: react-email-analysis
loglevel: info
analyses:
- analysis_name: react email analysis
  source_directory:  /tmp/emerge/packages
  only_permit_languages:
  - typescript
  only_permit_file_extensions:
  - .ts
  - .tsx
  ignore_files_containing:
  - .spec.tsx
  ignore_dependencies_matching:
  - (.*)\.spec\.tsx
  file_scan:
  - number_of_methods
  - source_lines_of_code
  - dependency_graph
  - fan_in_out
  - louvain_modularity
  - tfidf
  export:
  - directory:  /tmp/emerge/export
  - graphml
  - json
  - tabular_file
  - tabular_console_overall
  - d3
  1. Run the tool
docker run --rm -v <full path to the root of the project cloned on machine>:/tmp/emerge achtelik/emerge:2.0.0 /tmp/emerge/config.yml
  1. Once emerge is done, open the emerge.html page generated
  2. See that test files (.spect.tsx) are in the graph

Expected behavior
Any file filtered by the config options ignore_files_containing and ignore_dependencies_matching is not present in the output.

Screenshots
Screenshot 2024-02-18 at 07 03 58

Additional context
Add any other context about the problem here.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions