Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mago Laravel Package

carthage-software/mago

Mago is an extremely fast PHP linter, formatter, and static analyzer written in Rust. It brings Rust-inspired speed and reliability to PHP projects with a modern toolchain and great developer experience, plus multiple install options (script, Homebrew, Composer).

View on GitHub
Deep Wiki
Context7

title: Listing files

Listing scanned files

The mago list-files command is a powerful debugging tool that shows you exactly which files Mago will process based on your configuration. This is essential for:

  • Verifying your configuration - Ensure paths, includes, and excludes work as expected
  • Debugging file selection - Understand why certain files are or aren't being processed
  • Tool integration - Generate file lists for external tools or scripts
  • Understanding tool-specific excludes - See how different tools process different file sets

Basic Usage

To get a list of all files in your source paths:

mago list-files

This shows files from your paths configuration (your source code that will be analyzed, linted, and formatted). Files from includes (dependencies) are not shown in the basic output.

Tool-Specific File Lists

Each Mago tool (linter, formatter, analyzer, guard) can have its own excludes configuration that applies in addition to the global source.excludes. This means different tools may process different sets of files.

To see which files a specific tool will process:

# Files the linter will check
mago list-files --command linter

# Files the formatter will format
mago list-files --command formatter

# Files the analyzer will analyze
mago list-files --command analyzer

# Files the guard will check
mago list-files --command guard

Example: Why Files Differ Between Tools

Given this configuration:

[source]
paths = ["src", "tests"]
excludes = ["cache/**"]  # Excluded from ALL tools

[analyzer]
excludes = ["tests/**/*.php"]  # Additionally excluded from analyzer

[formatter]
excludes = ["src/**/AutoGenerated/**"]  # Additionally excluded from formatter

The file lists will differ:

# Shows: src/** + tests/** (minus cache/**)
mago list-files

# Shows: src/** only (tests excluded from analyzer)
mago list-files --command analyzer

# Shows: src/** + tests/** (minus AutoGenerated files)
mago list-files --command formatter

As filenames may contain newlines, the default of printing one name per line is prone to errors when passing the list to other tools like xargs. In that case, you can have the filenames be zero-terminated instead:

mago list-files -0 | xargs -0r ls -l

Command reference

:::tip For global options that can be used with any command, see the Command-Line Interface overview. Remember to specify global options before the list-files command. :::

Usage: mago list-files [OPTIONS]

Options

Flag, Alias(es) Description
--command Select for which command the file list should be generated. Values: linter, formatter, analyzer, guard
-0, --zero-terminate Use NUL bytes instead of newlines to terminate the filenames.
-h, --help Print help information.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport