top of page

Overview of Fractal X

ignore.fractal (Is this needed?)

Code Map Analyzer: Custom File Exclusion with ignore.fractal

Overview:

The Code Map Analyzer is a powerful tool that helps map out relationships and dependencies in your codebase. To give you control over which files and directories get included in the analysis, the analyzer supports both .gitignore and a custom file called ignore.fractal.

​

The ignore.fractal file lets you exclude specific files or directories from being analyzed without affecting their Git tracking status. This is especially useful when you want files to remain in your repository but don’t need them to be included in the code mapping process.

​

How It Works:

  1. .gitignore: The analyzer reads the .gitignore file first to skip any files or directories specified there. This is standard behavior and mirrors what Git itself does.

  2. ignore.fractal: After reading .gitignore, the analyzer looks for an ignore.fractal file. This custom file allows you to define additional exclusions specifically for the code map analysis, without affecting Git.

​

Why Use ignore.fractal?

Sometimes, there are files or directories that should be tracked by Git (such as build scripts or environment files), but you don't want them to be included in the code map. The ignore.fractal file gives you a way to ignore files for the analyzer only, while keeping them in your Git repository.

​

How to Create and Use ignore.fractal

  1. Create the File:

    • In the root of your project (or the directory you're analyzing), create a file named ignore.fractal.

  2. Define Patterns:

    • Inside the ignore.fractal file, you can define patterns of files or directories to exclude from the analysis. This works similarly to .gitignore.

​

Example ignore.fractal File: (The Code in this section needs to be better explained)

# Ignore the node_modules directory but still track it in Git node_modules/ # Ignore build directories and output files build/ dist/ # Ignore all log files *.log # Ignore environment files but keep them in Git .env secret.config # Ignore JavaScript files in the scripts folder scripts/*.js # Ignore everything in the test_data folder test_data/*

​

Key Differences Between .gitignore and ignore.fractal:

  • .gitignore: Prevents files from being tracked in Git and also excludes them from the code analysis.

  • ignore.fractal: Excludes files from the Code Map Analyzer only, allowing them to remain tracked in Git. This provides more flexibility, especially when you want to keep certain files in your repository but not include them in the code mapping.

​

When to Use Both .gitignore and ignore.fractal:

  • Use .gitignore: When you want to exclude files from both Git tracking and code analysis.

  • Use ignore.fractal: When you still want files in your Git repository, but don’t need them to be included in the code map.

​

Example:

If you have a build script or a configuration file that you want to keep in your Git repository but avoid it being included in the code map, you can add it to the ignore.fractal file: (This needs a better visual example)

​

scripts/build.js .env

​

In this case:

  • The build script (scripts/build.js) and environment file (.env) will be skipped during the code analysis but will still be part of your Git repository.

  • If you add *.log to both .gitignore and ignore.fractal, the .log files won’t be tracked by Git or analyzed by the Code Map Analyzer.

​

Important Notes:

  • Presence of the Files: For the exclusion rules to work, either .gitignore or ignore.fractal (or both) must exist in the directory you are mapping.

  • If no .gitignore or ignore.fractal exists in the directory, the Code Map Analyzer will analyze all files in that directory.

​

How the Code Map Analyzer Uses These Files:

  1. Read the .gitignore file first to skip files and directories defined there.

  2. Read the ignore.fractal file for additional patterns to ignore specific files from the analysis.

  3. Any files not mentioned in either file will be analyzed.

​

Sample Workflow:

Step 1: Create or Edit .gitignore:

# .gitignore node_modules/ dist/ *.log

Define the files you don’t want tracked by Git or analyzed.

​

Step 2: Create ignore.fractal:

# ignore.fractal build/ scripts/build.js .env

Define additional files you want ignored from analysis but still tracked in Git.

​

Step 3: Run the Code Map Analyzer:

  • When you run the Code Map Analyzer, it will first check .gitignore and then ignore.fractal to skip files that match the patterns.
  • Only files not excluded by either file will be analyzed and included in the code map.

​

FAQ:

Q: What if I don’t have a .gitignore or ignore.fractal file?

​

  • The Code Map Analyzer will analyze all files in the directory if neither file is present. You should create one or both files to control which files are excluded.

​

Q: Can I use wildcards in ignore.fractal?

​

  • Yes, just like in .gitignore, you can use wildcards to exclude patterns of files, such as *.log to ignore all .log files.

​

Q: What happens if I add a file to .gitignore but not ignore.fractal?

​

  • The file will be ignored by both Git and the analyzer. If you want to keep the file in Git but exclude it from the code map, add it to ignore.fractal instead.

​

Conclusion:

The ignore.fractal file gives you fine-grained control over what files are included in the code mapping process without affecting your Git repository. By using both .gitignore and ignore.fractal together, you can ensure that the Code Map Analyzer focuses on the most relevant parts of your codebase while ignoring unnecessary or sensitive files.

For best results, we recommend creating an ignore.fractal file in the root of any project you wish to analyze and customizing it based on your specific needs.

List Title

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

List Title

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

List Title

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

123-456-7890

500 Terry Francine Street, 6th Floor, San Francisco, CA 94158

Stay Connected with Us

Contact Us

bottom of page