Class LanguageCheckTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.github.sergeloie.languagecheck.LanguageCheckTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@DisableCachingByDefault(because="The scanned file set is the whole project working tree, not modelled as task inputs.") public abstract class LanguageCheckTask extends org.gradle.api.DefaultTask
The languageCheck verification task.

Scans every included file against a CharPolicy derived from the configuration: ASCII-only extensions use a strict ASCII policy, mapped extensions use the union of their languages' alphabets, and those listed in formattingExtensions additionally allow the global formatting characters; everything else is skipped. Violations are written to the report file; the build fails when failOnViolation is enabled.

The task always re-runs (upToDateWhen(false)) and is not cacheable: the scanned file set is the whole project working tree, which is not modeled as task inputs. All properties are @Internal by design for the same reason.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.SetProperty<String>
     
    abstract org.gradle.api.provider.MapProperty<String,File>
    User-supplied language files, keyed by language code.
    abstract org.gradle.api.provider.SetProperty<String>
     
    abstract org.gradle.api.provider.SetProperty<String>
     
    abstract org.gradle.api.provider.SetProperty<String>
     
    abstract org.gradle.api.provider.MapProperty<String,Set<String>>
     
    abstract org.gradle.api.provider.Property<Boolean>
     
    abstract org.gradle.api.provider.SetProperty<String>
     
    abstract org.gradle.api.provider.Property<Long>
    Timeout for the git ls-files subprocess (GIT scan mode), in seconds.
    abstract org.gradle.api.provider.Property<Long>
     
    abstract org.gradle.api.provider.Property<Integer>
     
    abstract org.gradle.api.file.DirectoryProperty
    The project root directory, wired by the plugin at configuration time.
    abstract org.gradle.api.file.RegularFileProperty
     
    abstract org.gradle.api.provider.Property<ScanMode>
     
    abstract org.gradle.api.provider.SetProperty<String>
     
    void
    run()
     

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • LanguageCheckTask

      public LanguageCheckTask()
  • Method Details

    • getScanMode

      @Internal public abstract org.gradle.api.provider.Property<ScanMode> getScanMode()
    • getExcludedFiles

      @Internal public abstract org.gradle.api.provider.SetProperty<String> getExcludedFiles()
    • getExcludedDirs

      @Internal public abstract org.gradle.api.provider.SetProperty<String> getExcludedDirs()
    • getExcludedExtensions

      @Internal public abstract org.gradle.api.provider.SetProperty<String> getExcludedExtensions()
    • getExtensionLanguages

      @Internal public abstract org.gradle.api.provider.MapProperty<String,Set<String>> getExtensionLanguages()
    • getAsciiOnlyExtensions

      @Internal public abstract org.gradle.api.provider.SetProperty<String> getAsciiOnlyExtensions()
    • getFormattingExtensions

      @Internal public abstract org.gradle.api.provider.SetProperty<String> getFormattingExtensions()
    • getUtf8ExemptExtensions

      @Internal public abstract org.gradle.api.provider.SetProperty<String> getUtf8ExemptExtensions()
    • getMaxFileSize

      @Internal public abstract org.gradle.api.provider.Property<Long> getMaxFileSize()
    • getMaxViolationsPerFile

      @Internal public abstract org.gradle.api.provider.Property<Integer> getMaxViolationsPerFile()
    • getFailOnViolation

      @Internal public abstract org.gradle.api.provider.Property<Boolean> getFailOnViolation()
    • getGitTimeoutSeconds

      @Internal public abstract org.gradle.api.provider.Property<Long> getGitTimeoutSeconds()
      Timeout for the git ls-files subprocess (GIT scan mode), in seconds.
    • getCustomLanguages

      @Internal public abstract org.gradle.api.provider.MapProperty<String,File> getCustomLanguages()
      User-supplied language files, keyed by language code. The files themselves are @Internal because the task is never cached and always re-runs; the scanned file set is the whole working tree.
    • getReportFile

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getReportFile()
    • getProjectDirectory

      @Internal public abstract org.gradle.api.file.DirectoryProperty getProjectDirectory()
      The project root directory, wired by the plugin at configuration time. A dedicated property (rather than Task.project) keeps the task compatible with the configuration cache, which forbids touching Project during execution.
    • run

      public void run()