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

Configuration overhaul #860

Merged
merged 1 commit into from Apr 29, 2022
Merged

Conversation

dbrumann
Copy link
Collaborator

@dbrumann dbrumann commented Apr 12, 2022

  • Clarifies and introduces intended extension points (still experimental and work in progress!)
  • Changes namespaces and class names:
    • AstRunner > Ast
    • Collector > Layer\Collector
    • DependencyEmitter > Dependency\Emitter
    • RulesetEngine -> Result
    • Events are moved into a shared directory src/Event/
    • some classes were renamed and moved, e.g. file loading in Configuration is moved out into File instead
  • Reduces configuration layer in favor of having the class using the config (arrays) verify and process them
  • All configuration is now processed during container compilation allowing us to change how certain classes are collected and used (replace Registry with ContainerInterface).

@dbrumann dbrumann force-pushed the replace_formatter_config branch 2 times, most recently from b2887c6 to c29313f Compare April 12, 2022 19:55
@patrickkusebauch
Copy link
Collaborator

I have 2 questions that are not really clear to me about how they would be done going forward. And it might just be me not familiar with the Symfony Configuration/Container builder process:

  • Would it still be possible to have configurations for multiple different formatters in the same deptac.yaml file? And the correct one will be used based on the command line parameter choosing the formatter?
  • Is it still possible for multiple different formatters to use the same key in the deptac.yaml config file? Like the different GrapViz formatters do at the moment?

@dbrumann
Copy link
Collaborator Author

Would it still be possible to have configurations for multiple different formatters in the same deptac.yaml file? And the correct one will be used based on the command line parameter choosing the formatter?

Yes, you can still configure multiple formatters in the deptrac.yaml. We pick the right formatter using the FormatterProvider, much like we did before. Only that formatter will be instantiated during the analyse command all others are "dormant".

So, this should not change the behavior. For extensions this has the benefit that you can now register a custom formatter requiring configuration, without having to register the configuration file in Deptrac (e.g. like with ConfigurationGraphviz or ConfigurationCodeclimate).

Is it still possible for multiple different formatters to use the same key in the deptac.yaml config file? Like the different GrapViz formatters do at the moment?

Yes, at least that's how it is intended. The tagged_locator uses the static getName-function just like before to map a service to an alias. If you register a new service with that name, it should overwrite the existing one.

@dbrumann dbrumann force-pushed the replace_formatter_config branch 5 times, most recently from d78a4bf to f9b6d85 Compare April 19, 2022 10:12
@dbrumann dbrumann changed the title Move output config into container Configuration overhaul Apr 19, 2022
@dbrumann dbrumann force-pushed the replace_formatter_config branch 6 times, most recently from f5dfb98 to dccbda0 Compare April 19, 2022 13:29
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.

None yet

2 participants