Skip to content

jozsef-vesza/Annotator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Annotator

Annotator is a command line tool for annotating class extensions defined for protocol conformance. Adding these comments can ease navigation in source files (especially large ones), but can be quite cumbersome, so I decided to make a tool for it.

Without annotation:

With annotation:

Annotator leverages Apple's SwiftSyntax package for parsing/changing the source code.

Note: SwiftSyntax is still in development, and the API is not guaranteed to be stable. It's subject to change without warning. Always review the changes made by Annotator.

Installation

Using Swift Package Manager:

$ git clone https://github.com/jozsef-vesza/Annotator
$ cd Annotator
$ swift build -c release -Xswiftc -static-stdlib
$ cp -f .build/release/Annotator /usr/local/bin/annotator

Usage

Annotator takes a JSON configuration file as input with the following format:

// config.json
{
    "projectFolderPath": "path_to_project_root_folder",
    "excludedFileNames": [
        "ExcludedFile.swift"
    ],
    "excludedSubfolders": [
        "ExcludedFolderName"
    ]
}
  • projectFolderPath (required): the absolute path to the project's root folder
  • excludedFileNames (optional): a list of filenames to exclude
  • excludedSubfolders (optional): a list of folders to exclude

Once the configuration file is ready, supply it to Annotator as a parameter:

$ annotator path_to_configuration_json_file

About

A command line tool for annotating class extensions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages