<commit_before>package sbt
/*
TODO:
- index all available AutoPlugins to get the tasks that will be added
- error message when a task doesn't exist that it would be provided by plugin x, enabled by natures y,z, blocked by a, b
*/

	import logic.{Atom, Clause, Clauses, Formula, Literal, Logic, Negated}
	import Logic.{CyclicNegation, InitialContradictions, InitialOverlap, LogicException}
	import Def.Setting
	import Plugins._
	import annotation.tailrec

/** Marks a top-level object so that sbt will wildcard import it for .sbt files, `consoleProject`, and `set`. */
trait AutoImport

/**
An AutoPlugin defines a group of settings and the conditions where the settings are automatically added to a build (called "activation").
The `requires` and `trigger` method defines the conditions and a method like `projectSettings` defines the settings to add.

Steps for plugin authors:
1. Determine the [[AutoPlugins]]s that, when present (or absent), activate the AutoPlugin.
2. Determine the settings/configurations to automatically inject when activated.

For example, the following will automatically add the settings in `projectSettings`
  to a project that has both the `Web` and `Javascript` plugins enabled.

    object MyPlugin extends AutoPlugin {
        def requires = Web && Javascript
        override def projectSettings = Seq(...)
    }

Steps for users:
1. Add dependencies on plugins in `project/plugins.sbt` as usual with `addSbtPlugin`
2. Add key plugins to Projects, which will automatically select the plugin + dependent plugin settings to add for those Projects.
3. Exclude plugins, if desired.

For example, given plugins Web and Javascript (perhaps provided by plugins added with addSbtPlugin),

  <Project>.addPlugins( Web && Javascript )

will activate `MyPlugin` defined above and have its settings automatically added.  If the user instead defines

  <Project>.addPlugins( Web && Javascript ).disablePlugins(MyPlugin)

then the `MyPlugin` settings (and anything that activates only when `MyPlugin` is activated) will not be added.
*/
abstract class AutoPlugin extends Plugins.Basic with PluginsFunctions
{
	/** Determines whether this AutoPlugin will be activated for this project when the `requires` clause is satisfied.
	 *
	 * When this method returns `allRequirements`, and `requires` method returns `Web && Javascript`, this plugin
	 * instance will be added automatically if the `Web` and `Javascript` plugins are enbled.
	 * 
	 * When this method returns `noTrigger`, and `requires` method returns `Web && Javascript`, this plugin
	 * instance will be added only if the build user enables it, but it will automatically add both `Web` and `Javascript`. */
	def trigger: PluginTrigger

	/** This AutoPlugin requires the plugins the [[Plugins]] matcher returned by this method. See [[trigger]].
	 */<commit_msg>Updated comments. Typo fix per @jozic<commit_after>package sbt
/*
TODO:
- index all available AutoPlugins to get the tasks that will be added
- error message when a task doesn't exist that it would be provided by plugin x, enabled by natures y,z, blocked by a, b
*/

	import logic.{Atom, Clause, Clauses, Formula, Literal, Logic, Negated}
	import Logic.{CyclicNegation, InitialContradictions, InitialOverlap, LogicException}
	import Def.Setting
	import Plugins._
	import annotation.tailrec

/** Marks a top-level object so that sbt will wildcard import it for .sbt files, `consoleProject`, and `set`. */
trait AutoImport

/**
An AutoPlugin defines a group of settings and the conditions where the settings are automatically added to a build (called "activation").
The `requires` and `trigger` methods together define the conditions, and a method like `projectSettings` defines the settings to add.

Steps for plugin authors:
1. Determine if the AutoPlugin should automatically be activated when all requirements are met, or should be opt-in.
2. Determine the [[AutoPlugins]]s that, when present (or absent), act as the requirements for the AutoPlugin.
3. Determine the settings/configurations to that the AutoPlugin injects when activated.

For example, the following will automatically add the settings in `projectSettings`
  to a project that has both the `Web` and `Javascript` plugins enabled.

    object MyPlugin extends AutoPlugin {
        def requires = Web && Javascript
        def trigger = allRequirements
        override def projectSettings = Seq(...)
    }

Steps for users:
1. Add dependencies on plugins in `project/plugins.sbt` as usual with `addSbtPlugin`
2. Add key plugins to Projects, which will automatically select the plugin + dependent plugin settings to add for those Projects.
3. Exclude plugins, if desired.

For example, given plugins Web and Javascript (perhaps provided by plugins added with addSbtPlugin),

  <Project>.addPlugins( Web && Javascript )

will activate `MyPlugin` defined above and have its settings automatically added.  If the user instead defines

  <Project>.addPlugins( Web && Javascript ).disablePlugins(MyPlugin)

then the `MyPlugin` settings (and anything that activates only when `MyPlugin` is activated) will not be added.
*/
abstract class AutoPlugin extends Plugins.Basic with PluginsFunctions
{
	/** Determines whether this AutoPlugin will be activated for this project when the `requires` clause is satisfied.
	 *
	 * When this method returns `allRequirements`, and `requires` method returns `Web && Javascript`, this plugin
	 * instance will be added automatically if the `Web` and `Javascript` plugins are enbled.
	 * 
	 * When this method returns `noTrigger`, and `requires` method returns `Web && Javascript`, this plugin
	 * instance will be added only if the build user enables it, but it will automatically add both `Web` and `Javascript`. */
	def trigger: PluginTrigger

	/** This AutoPlugin requires the plugins the [[Plugins]] matcher returned by this method. See [[trigger]].
	 */
{'fraction_non_alphanumeric': 0.07131940906775344, 'fraction_numerical': 0.0018678892851078282, 'mean_word_length': 4.49953314659197, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2961691', 'n_tokens_mistral': 1541, 'n_tokens_neox': 1441, 'n_words': 767}