Commit Graph

40 Commits

Author SHA1 Message Date
Jordan Rose
0f071e28ea Simplify getPrepositionKind to isPreposition
No one was distinguishing directional and non-directional prepositions
anymore. No functionality change.
2019-10-16 19:55:46 -07:00
Alex Blewitt
f18115f27d Remove duplicate verb
`VERB(hang)` appeared twice in this file.
2018-02-20 19:03:38 +00:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
Abdou Sarr
3735c914a4 Omitted Dream repetition. (#4355)
"VERB(Dream)" was repeated twice on line 268 and 269. So I removed the type on 268.
2016-08-17 12:19:14 -07:00
Doug Gregor
6b1210ed52 [Omit needless words] Add "unload" as a verb, to go with "load".
Fixes rdar://problem/26866251.
2016-08-01 11:25:23 -07:00
Doug Gregor
ddbecf0852 [Omit needless words] "Preceding" is a preposition.
Fixes rdar://problem/25075516.
2016-04-26 17:27:25 -07:00
Doug Gregor
abaa4dd7ab [Omit needless words] "Gain" is a verb.
Fixes rdar://problem/25017122.
2016-04-26 17:18:20 -07:00
Doug Gregor
d2cb7a607f [Omit needless words] "Scale" is a verb.
Fixes rdar://problem/24817973.
2016-04-26 17:11:04 -07:00
Doug Gregor
4e16f625b1 [Omit needless words] "de-" is a verb prefix.
... and handle verb prefixes properly.
2016-02-22 14:11:09 -08:00
Doug Gregor
03fe1d0a35 [Omit needless words] More Cocoa verbs: activate, deactivate, reattach.
Fixes rdar://problem/23556916.
2016-02-22 11:22:09 -08:00
Doug Gregor
4b116d0e26 [Omit needless words] enqueue/dequeue are verbs 2016-02-16 16:17:56 -08:00
Doug Gregor
1cd7a8611d [Omit needless words] Introduce set-specific verbs. 2016-02-12 12:52:13 -08:00
Doug Gregor
bdfedf70ed [Omit needless words] Treat "passing" as a preposition 2016-02-12 10:53:35 -08:00
Doug Gregor
f61aa7a86e [Omit needless words] Prepend is a verb. 2016-02-11 16:44:06 -08:00
Doug Gregor
4bbdec1cfc [Omit needless words] "update" is a verb. 2016-02-11 16:44:05 -08:00
Doug Gregor
850e0e2fc3 [Omit needless words] Skip over verbs and gerunds when looking for a preposition. 2016-02-11 16:44:04 -08:00
Doug Gregor
10e98da40d [Omit needless words] Clip is a poor verb for Cocoa imports 2016-02-11 16:44:04 -08:00
Doug Gregor
10c2a48ffc [Omit needless words] Tweak the verb lists slightly. 2016-02-05 22:27:44 -08:00
Doug Gregor
4d2480086e [Omit needless words] Use the getter name for BOOL properties.
Rather than employ complicated heuristics to determine when to add
"is" to the name of a Booleam property, just trust the name of the
getter.
2016-01-05 10:43:32 -08:00
practicalswift
c48a25647d Use correct formatting for separator line. 2016-01-05 09:49:00 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Doug Gregor
e60e5a3605 Omit needless words: more verbs from Cocoa
Add apportion, cast, defer, flip, and generate.

Swift SVN r32459
2015-10-06 07:03:18 +00:00
Doug Gregor
7778790a68 Omit needless words: prepend "is" to Boolean property names.
Prepend       "is" to        Boolean property names (e.g., "empty" becomes
"isEmpty") unless the property name strongly indicates its Boolean
nature or we're   likely to ruin the name. Therefore, the  presence of
one of the following in  the property name will suppress   this
transformation:

* An auxiliary verb, such as "is", "has", "may", "should", or "will".

* A word ending in "s", indicating either a plural (for which
  prepending "is" would be incorrect) or a verb in the continuous
  tense (which indicates its Boolean nature, e.g., "translates" in
  "translatesCoordinates").

Swift SVN r32458
2015-10-06 07:03:17 +00:00
Doug Gregor
bf55d2712e Omit needless words: add some more verbs found in Cocoa.
Add adjust, alter, animate, capture, center, collapse, define, dim,
echo, enable, export, import, localize, maintain, notify, preload,
require, retain, resize, reuse, suppress, translate, traverse,
<re>verb and auto<verb>.

Swift SVN r32457
2015-10-06 07:03:09 +00:00
Doug Gregor
f90f9a61dc Omit needless words: verb adjustments.
Added verbs: decode, encode, normalize, truncate
Removed verbs: beam

Swift SVN r32381
2015-10-01 21:44:10 +00:00
Doug Gregor
b71ebde067 Omit needless words: "flatten" is a verb.
Swift SVN r32130
2015-09-21 22:52:17 +00:00
Doug Gregor
65b7e6d787 Omit needless words: "customize" is a verb.
Swift SVN r32120
2015-09-21 19:46:13 +00:00
Doug Gregor
8e6d7665ce Omit needless words: strip result type info from both sides of a zero-argument method.
This takes an highly-redundant API name like NSBezierPath's

  func bezierPathByReversingPath() -> NSBezierPath

and turns it into

  func reversing() -> NSBezierPath

Also, handle 'instancetype' properly when omitting words matching the
result type from the front of the base name.

Swift SVN r32119
2015-09-21 19:46:12 +00:00
Doug Gregor
81850079ac Omit needless words: "file", "name", and "point" are terrible verbs.
The noun forms of these words dominate.

Swift SVN r32118
2015-09-21 19:46:08 +00:00
Doug Gregor
0e3ef0c69d Revert "Omit needless words: split base names on the last preposition."
This reverts commit r31976; this was still not a good idea.

Swift SVN r32079
2015-09-18 21:51:08 +00:00
Doug Gregor
838759d155 Omit needless words: remove arguments that match the default arguments.
For cases where the Clang importer provides a defaulted argument,
e.g., "[]" for option sets and "nil" for optionals, remove the
corresponding arguments at any call sites that simply specify "[]" or
"nil". Such arguments are basically noise, and tend to harm
readability when there are low-content argument labels like "with:" or
"for".

Some examples from Lister:

  self.updateUserActivity(AppConfiguration.UserActivity.watch,
                          userInfo: userInfo, webpageURL: nil)

becomes

  self.updateUserActivity(AppConfiguration.UserActivity.watch,
                          userInfo: userInfo)

and

  contentView.hitTest(tapLocation, with: nil)

becomes

  contentView.hitTest(tapLocation)

and

  document.closeWithCompletionHandler(nil)

becomes simply

  document.close()

and a whole pile of optional "completion handler" arguments go away.

Swift SVN r31978
2015-09-15 22:45:50 +00:00
Doug Gregor
2f0fc4ce4b Omit needless words: split base names on the last preposition.
For methods with at least a single parameter, split the base name at
the last preposition, so long as there are no other verbs or gerunds
in between. This separates out the action of the method from the
description of the first parameter, the latter of which can still have
needless words removed. This is particularly fun with
appendBezierPath*:

  func appendBezierPath(with _: NSRect)
  func appendBezierPath(withPoints _: NSPointArray, count: Int)
  func appendBezierPathWithOval(`in` _: NSRect)
  func appendBezierPathWithArc(withCenter _: NSPoint, radius: CGFloat,
  startAngle: CGFloat, endAngle: CGFloat, clockwise: Bool)
  func appendBezierPathWithArc(withCenter _: NSPoint, radius: CGFloat,
  startAngle: CGFloat, endAngle: CGFloat)
  func appendBezierPathWithArc(from _: NSPoint, to: NSPoint, radius:
  CGFloat)
  func appendBezierPath(with _: NSGlyph, `in`: NSFont)
  func appendBezierPath(withGlyphs _: UnsafeMutablePointer<NSGlyph>,
  count: Int, `in`: NSFont)
  func appendBezierPath(withPackedGlyphs _: UnsafePointer<Int8>)
  @available(OSX 10.5, *)
  func appendBezierPath(withRoundedRect _: NSRect, xRadius: CGFloat,
  yRadius: CGFloat)

Note: "point" and "name" are terrible verbs.

Swift SVN r31976
2015-09-15 22:45:43 +00:00
Doug Gregor
e05ba143e7 Omit needless words: abbreviate, standardize, and resolve are verbs.
Swift SVN r31700
2015-09-04 23:57:08 +00:00
Doug Gregor
7960ca1619 Omit needless words: strip out prefixes that are redundant with the result type.
When the prefix of a method/property name is restating the result
type, followed by "By" and then a gerund, drop everything up to the
gerund. For example:

  func stringByAppendingString(string: String) -> String

becomes

  func appending(string: String) -> String

Swift SVN r31683
2015-09-04 00:07:38 +00:00
Doug Gregor
4925d24fdb Omit needless words: "toggle" is a verb.
Swift SVN r31669
2015-09-03 20:39:49 +00:00
Doug Gregor
685539875f Omit needless words: "object" is a terrible verb
Swift SVN r31667
2015-09-03 17:06:53 +00:00
Doug Gregor
271fc2057e Omit needless words: add some verbs found in Cocoa APIs
Swift SVN r31659
2015-09-03 05:44:17 +00:00
Doug Gregor
8ce50fbd76 Omit needless words: only omit words when they are preceded by a verb or preposition.
The presence of a verb or preposition prior to the redundant part
provides a firm linguistic split that lets the actual argument fill in
for the reader. For other parts of speech (adjectives, especially)
it's awkward to transition from "reading part of the name" to "reading
the argument". This eliminates a significant number of bad omissions,
e.g., "setTextColor()" -> "setText()", and generally makes the
transformation more conservative.

Swift SVN r31656
2015-09-03 05:04:11 +00:00