<commit_before># Package Editor Commands

* Proposal: [SE-0301](0301-package-editing-commands.md) 
* Authors: [<NAME>](https://github.com/owenv)
* Review Manager: [<NAME>](https://github.com/tomerd)
* Status: **Active Review (Feburary 4...February 15, 2021)**
* Implementation: [apple/swift-package-manager#3034](https://github.com/apple/swift-package-manager/pull/3034)


## Introduction

Because Swift package manifests are written in Swift using the PackageDescription API, it is difficult to automate common tasks like adding a new product, target, or dependency. This proposal introduces new `swift package` subcommands to perform some common editing tasks which can streamline users' workflows and enable new higher-level tools.

Forums Discussion: https://forums.swift.org/t/pitch-package-editor-commands/42224/

## Motivation

There are a number of reasons someone might want to make changes to a package using a CLI or library interface instead of editing a manifest by hand:

- In some situations, it's less error-prone than editing the manifest manually. Package authors could provide a one line command in their README to easily integrate the latest version as a dependency.
- Because more of the process is automated, users would no longer need to remember details of the package layout convention, like which files and folders they need to create when adding a new library target.
- Using libSwiftPM, IDEs could offer to update the manifest automatically when the user tries to import a missing dependency or create a new target.
- Users could add packages from their package collections as dependencies by name instead of URL

Additionally, many other package managers offer similar features:
- npm's [`npm install`](https://docs.npmjs.com/specifying-dependencies-and-devdependencies-in-a-package-json-file#adding-dependencies-to-a-packagejson-file-from-the-command-line) command for adding dependencies to its `package.json`
- Tools like [cargo-edit](https://github.com/killercup/cargo-edit) for editing the `cargo.toml` format used by Rust
- Elm's [`elm install`](https://elmprogramming.com/elm-install.html) command for adding dependencies to `elm.json`

## Proposed solution<commit_msg>Mark SE-0301 as accepted (#1275)<commit_after># Package Editor Commands

* Proposal: [SE-0301](0301-package-editing-commands.md) 
* Authors: [<NAME>](https://github.com/owenv)
* Review Manager: [<NAME>](https://github.com/tomerd)
* Status: **Accepted**
* Implementation: [apple/swift-package-manager#3034](https://github.com/apple/swift-package-manager/pull/3034)
* Review: [Review](https://forums.swift.org/t/se-0301-package-editor-commands/)

## Introduction

Because Swift package manifests are written in Swift using the PackageDescription API, it is difficult to automate common tasks like adding a new product, target, or dependency. This proposal introduces new `swift package` subcommands to perform some common editing tasks which can streamline users' workflows and enable new higher-level tools.

Forums Discussion: https://forums.swift.org/t/pitch-package-editor-commands/42224/

## Motivation

There are a number of reasons someone might want to make changes to a package using a CLI or library interface instead of editing a manifest by hand:

- In some situations, it's less error-prone than editing the manifest manually. Package authors could provide a one line command in their README to easily integrate the latest version as a dependency.
- Because more of the process is automated, users would no longer need to remember details of the package layout convention, like which files and folders they need to create when adding a new library target.
- Using libSwiftPM, IDEs could offer to update the manifest automatically when the user tries to import a missing dependency or create a new target.
- Users could add packages from their package collections as dependencies by name instead of URL

Additionally, many other package managers offer similar features:
- npm's [`npm install`](https://docs.npmjs.com/specifying-dependencies-and-devdependencies-in-a-package-json-file#adding-dependencies-to-a-packagejson-file-from-the-command-line) command for adding dependencies to its `package.json`
- Tools like [cargo-edit](https://github.com/killercup/cargo-edit) for editing the `cargo.toml` format used by Rust
- Elm's [`elm install`](https://elmprogramming.com/elm-install.html) command for adding dependencies to `elm.json`

## Proposed solution
{'fraction_non_alphanumeric': 0.087248322147651, 'fraction_numerical': 0.013646532438478748, 'mean_word_length': 5.033738191632929, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 15, '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': '5925397', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1130, 'n_words': 496}