glato / emerge

Emerge is a browser-based interactive codebase and dependency visualization tool for many different programming languages. It supports some basic code quality and graph metrics and provides a simple and intuitive way to explore and analyze a codebase by using graph structures.
MIT License
767 stars 45 forks source link

Test files are included in the output #49

Open rafaelrozon opened 4 months ago

rafaelrozon commented 4 months ago

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

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
  2. 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
  3. Once emerge is done, open the emerge.html page generated
  4. 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!

henriquegouveia commented 2 weeks ago

I opened a PR fixing this issue. Here it's: https://github.com/glato/emerge/pull/52