Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] ComposerCollector: adding new parameters include and includeDev to separate the list of packages #80

Open
wants to merge 1 commit into
base: 2.0.x
Choose a base branch
from

Conversation

Kaspiman
Copy link

@Kaspiman Kaspiman commented Oct 2, 2024

Hello! Linked issue - Add a setting to separate packages from require and require-dev sections for Composer collector.

The packages parameter becomes optional and acts as an additional filter for the composer packages.

Example config:

deptrac:
  layers:
    - name: ComposerWithoutDev
      collectors:
        - type: composer
          composerPath: composer.json
          composerLockPath: composer.lock
          includeDev: false
     - name: ComposerOnlyDev
       collectors:
         - type: composer
           composerPath: composer.json
           composerLockPath: composer.lock
           include: false
           includeDev: true
      - name: ComposerCheckSomeDeps
         collectors:
           - type: composer
             composerPath: composer.json
             composerLockPath: composer.lock
             packages: [ "some/package-from-non-dev-section" ]
             include: true
             includeDev: false

I kept backward compatibility and added tests.

What do you think about include and includeDev naming?

@@ -128,7 +128,7 @@ The `composer` collector allows you to define dependencies on composer `require`
- That your `require-dev` dependencies are only used in you non-production code (like DB migrations or SA tools)
- That your code does not use any transitive dependencies (dependencies on packages installed only because your `composer.json` required packages depend on them themselves)
- That some packages are only used in particular layers

### TODO Change docs after review!
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant