目录

Ross 🧼

Ross is a Swift command-line tool to remove all comments from Swift code.

-/**
-Registers a handler in an `Application` for a given path.
-
-- Parameters:
-  - app: The `Application` to register the handler in.
-  - path: The path to register the handler for.
-*/
public func register(in app: Application, for path: String) {
  app.on(method, path.pathComponents) { [handle] req async throws in
    try await handle(req)
  }
}

Warning Right now, Ross almost certainly won’t remove all of the comments that you are interested in removing. If you find a comment left behind, please file an issue so that we can add the appropriate specialized version of the visit(_:) function along with a test case.

Basic usage

swift run ross <directory> [--remove-plain <remove-plain>]
ARGUMENTS:
  <directory>             The folder whose contents you want to remove comments from.

OPTIONS:
  --remove-plain <remove-plain>
                          Whether or not Ross should remove plain comments. (default: true)
  -h, --help              Show help information.

It is recommended to pair this with swift-format, specifically the "maximumBlankLines" rule, in order to deal with any extraneous newlines that may remain after comments are removed.

Why Ross?

Charles Ross, President Harry Truman’s White House press secretary, was responsible for the first recorded usage of “no comment” as a stock answer to a question.

关于
55.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号