Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
pantsbuild.pants / task / fmt_task_mixin.py
Size: Mime:
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.task.target_restriction_mixins import (
    DeprecatedSkipAndDeprecatedTransitiveGoalOptionsRegistrar,
    HasSkipAndTransitiveGoalOptionsMixin,
)


class FmtGoalRegistrar(DeprecatedSkipAndDeprecatedTransitiveGoalOptionsRegistrar):
    @classmethod
    def register_options(cls, register):
        super().register_options(register)
        register(
            "--only",
            type=str,
            default=None,
            fingerprint=True,
            advanced=True,
            help="Only run the specified formatter. Currently the only accepted values are "
            "`scalafix` or not setting any value.",
        )


class FmtTaskMixin(HasSkipAndTransitiveGoalOptionsMixin):
    """A mixin to combine with code formatting tasks."""

    goal_options_registrar_cls = FmtGoalRegistrar
    target_filtering_enabled = True