From 8b3acf21af482511d258756b7b28ea1b4e581ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scheibe?= Date: Mon, 15 Oct 2018 23:44:37 +0200 Subject: [PATCH] Fix typos --- CONTRIBUTING.md | 10 +++++----- docs/consumer.adoc | 8 ++++---- docs/implementation.adoc | 8 ++++---- src/main/java/jenkins/scm/api/SCMEvent.java | 4 ++-- src/main/java/jenkins/scm/api/SCMSource.java | 2 +- .../jenkins/scm/api/metadata/AvatarMetadataAction.java | 2 +- .../jenkins/scm/api/mixin/ChangeRequestSCMHead2.java | 2 +- .../java/jenkins/scm/api/trait/SCMHeadAuthority.java | 6 +++--- .../scm/api/trait/SCMHeadAuthorityDescriptor.java | 2 +- .../jenkins/scm/api/trait/SCMNavigatorRequest.java | 4 ++-- .../scm/api/trait/SCMNavigatorTraitDescriptor.java | 2 +- .../java/jenkins/scm/api/trait/SCMSourceRequest.java | 2 +- .../scm/api/trait/SCMSourceTraitDescriptor.java | 2 +- .../java/jenkins/scm/api/trait/SCMTraitDescriptor.java | 2 +- src/main/resources/jenkins/scm/api/form/traits.jelly | 2 +- .../java/jenkins/scm/impl/SingleSCMSourceTest.java | 2 +- 16 files changed, 30 insertions(+), 30 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ab89a7c..9f040731 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,8 +24,8 @@ Truths which we believe to be self-evident (adapted from [TextSecure's](https:// 1. **The answer is not more options.** If you feel compelled to add a preference that's exposed to the user, it's very possible you've made a wrong turn somewhere. 2. **There are no power users.** The idea that some users "understand" concepts better than others has proven to be, for the post part, false. If anything, "power users" are more dangerous than the test, and we should avoid exposing dangerous functionality to them. 3. **If it's "like PGP," it's wrong.** PGP is our guide for what not to do. -4. **It's an asynchronous world.** We wary of anything that is anti-asynchronous: ACKs, protocol confirmations, or anly protocol-level "advisory" message. -5. **There is no such thing as time**. Protocol ideas that require synchonized clocks are doomed to failure. +4. **It's an asynchronous world.** We wary of anything that is anti-asynchronous: ACKs, protocol confirmations, or any protocol-level "advisory" message. +5. **There is no such thing as time**. Protocol ideas that require synchronized clocks are doomed to failure. # Code Style Guidelines @@ -45,7 +45,7 @@ Truths which we believe to be self-evident (adapted from [TextSecure's](https:// 1. "hungarian"-style notation is banned (i.e. instance variable names preceded by an 'm', etc) 2. If the field is `static final` then it shall be named in `ALL_CAPS_WITH_UNDERSCORES`. 3. Start variable names with a lowercase letter and use camelCase rather than under_scores. -4. Spelling and abreviations: If the word is widely used in the JVM runtime, stick with the spelling/abreviation in the JVM runtime, e.g. `color` over `colour`, `sync` over `synch`, `async` over `asynch`, etc. +4. Spelling and abbreviations: If the word is widely used in the JVM runtime, stick with the spelling/abbreviation in the JVM runtime, e.g. `color` over `colour`, `sync` over `synch`, `async` over `asynch`, etc. 5. It is acceptable to use `i`, `j`, `k` for loop indices and iterators. If you need more than three, you are likely doing something wrong and as such you shall either use full descriptive names or refactor. 6. It is acceptable to use `e` for the exception in a `try...catch` block. 7. You shall never use `l` (i.e. lower case `L`) as a variable name. @@ -114,7 +114,7 @@ To the greatest extent possible, please wrap lines to ensure that they do not ex */ @Override ``` -* Getters and Setters shall have a Javadoc comment. The following is prefered +* Getters and Setters shall have a Javadoc comment. The following is preferred ``` /** * The count of widgets @@ -155,7 +155,7 @@ To the greatest extent possible, please wrap lines to ensure that they do not ex + Indent case statements in switch - Wrapping + Change all the `Never` values to `If Long` - + Select the checkbox for Wrap After Assignement Operators + + Select the checkbox for Wrap After Assignment Operators * IntelliJ, by and large the IDE defaults are acceptable with the following changes: - Wrapping and Braces + Change `Do not wrap` to `Wrap if long` diff --git a/docs/consumer.adoc b/docs/consumer.adoc index badcd866..b6bc68a3 100644 --- a/docs/consumer.adoc +++ b/docs/consumer.adoc @@ -81,7 +81,7 @@ Each branch specific sub-job has: Other benefits include: * Developers can create feature branches and get the CI benefits for that feature branch automatically without needing to worry about requesting creation of corresponding feature branch jobs. -* The Jenkins administator does not need to worry about having to clean up old feature branch jobs that are no longer required. +* The Jenkins administrator does not need to worry about having to clean up old feature branch jobs that are no longer required. There still remain other issues that the Branch API plugin cannot solve on its own: @@ -91,7 +91,7 @@ If different branches need different job configuration -- which may be highly li * For inter-project dependencies, it can be unclear how to establish branch relationships. + -Should branch `feature-23` of project A be using the artifacts from branch `master` of project B or from branch `sustainging-1.x`. +Should branch `feature-23` of project A be using the artifacts from branch `master` of project B or from branch `sustaining-1.x`. Efforts to solve these issues are a responsibility of the plugins that implement multi-branch project types. @@ -136,7 +136,7 @@ The SCM API exposes four main extension points for consumers: Consumers will likely be interested in implementing the following extension points: -* The `jenkins.scm.api.SCMEventListener` extension point is designed to solve the use case of recieving notification of events from the source control systems. +* The `jenkins.scm.api.SCMEventListener` extension point is designed to solve the use case of receiving notification of events from the source control systems. Consumers will be required to implement the following contract interfaces depending on their use of the extension points of the SCM API: @@ -275,7 +275,7 @@ The listener will need to update the required `SCMNavigatorOwner` instances on t NOTE: `SCMSourceEvent` and `SCMHeadEvent` events can transition a project from non-interesting to interesting, so a `SCMNavigatorOwner` will need to listen out for these events also. For example, an Organization Folder for Workflow jobs would need to see if any SCMHeadEvent for a project name that has not been created yet leads to a verification as to whether the named head actually contains a `Jenkinsfile`. -If a `Jenkinsfile` were present then the project woudl need to be created in order to enable the branch specific grandchild job to be created. +If a `Jenkinsfile` were present then the project would need to be created in order to enable the branch specific grandchild job to be created. * Persist the results of `SCMNavigator.fetchActions(_owner_, _listener_)` as part of each index and on receipt of any `SCMNavigatorEvent` events of type `UPDATED`. + diff --git a/docs/implementation.adoc b/docs/implementation.adoc index 9b334939..e6cdd4e2 100644 --- a/docs/implementation.adoc +++ b/docs/implementation.adoc @@ -82,7 +82,7 @@ The `SCMRevision` of a GitHub pull request would actually be a composite revisio Another example of a collection of Git repositories could be a GitHub organization. * Subversion can have a fairly direct mapping of concepts analogous to the Git mapping above. -Alternatively some oganizations will use a single Subversion repository to hold multiple projects under which each project would have the familiar `trunk/branches/tags` structure. If we consider this style of Subversion use then: +Alternatively some organizations will use a single Subversion repository to hold multiple projects under which each project would have the familiar `trunk/branches/tags` structure. If we consider this style of Subversion use then: ** `jenkins.scm.api.SCMHead` would be mapped against a specific project and be one of: `trunk`, `branches/_name_` or `tags/_name_`. @@ -260,7 +260,7 @@ Each `jenkins.scm.api.SCMSourceDescriptor` should provide the concrete instances Then each `jenkins.scm.api.SCMSource` instance can filter down that list to the actual categories that may be returned by that specific source. For example, a GitHub source may return "Branches", "Pull Requests" and "Tags" but the user may have configured their specific source for a specific project to only build "Branches" and "Tags". -In an analgous way, the `jenkins.scm.api.SCMSource` instances themselves may have different terminology for each of the different source control systems: +In an analogous way, the `jenkins.scm.api.SCMSource` instances themselves may have different terminology for each of the different source control systems: * GitHub uses the term "Repository" to refer to primary repositories * GitHub uses the term "Fork" to refer to forks of the primary repositories @@ -1102,7 +1102,7 @@ public class MyChangeRequestSCMRevision extends ChangeRequestSCMRevisionThe {@link Cause} instances should probably be new instances each time, see * {@link Cause#onAddedTo(Run)}. * - * @return the {@link Cause} instances to add to any builds triggerd by this event. + * @return the {@link Cause} instances to add to any builds triggered by this event. */ @NonNull public Cause[] asCauses() { @@ -406,7 +406,7 @@ public enum Type { * */ CREATED, diff --git a/src/main/java/jenkins/scm/api/SCMSource.java b/src/main/java/jenkins/scm/api/SCMSource.java index 25613afa..edbabb8a 100644 --- a/src/main/java/jenkins/scm/api/SCMSource.java +++ b/src/main/java/jenkins/scm/api/SCMSource.java @@ -382,7 +382,7 @@ private void _retrieve(@CheckForNull SCMSourceCriteria criteria, } } else if (MethodUtils.isOverridden(SCMSource.class, getClass(), "retrieve", SCMHeadObserver.class, TaskListener.class)){ - // oh dear, realy old legacy implementation + // oh dear, really old legacy implementation SCMSourceCriteria hopefullyNull = compatibilityHack.get(); compatibilityHack.set(criteria == null ? nullSCMSourceCriteria : criteria); try { diff --git a/src/main/java/jenkins/scm/api/metadata/AvatarMetadataAction.java b/src/main/java/jenkins/scm/api/metadata/AvatarMetadataAction.java index eb569f97..2994cee9 100644 --- a/src/main/java/jenkins/scm/api/metadata/AvatarMetadataAction.java +++ b/src/main/java/jenkins/scm/api/metadata/AvatarMetadataAction.java @@ -44,7 +44,7 @@ import org.kohsuke.stapler.export.ExportedBean; /** - * Holds metadata about an avatar to be assoicated with a {@link SCMSource} or {@link SCMNavigator} (also valid for + * Holds metadata about an avatar to be associated with a {@link SCMSource} or {@link SCMNavigator} (also valid for * {@link SCMRevision} and {@link SCMHead}, but would be considered unusual). *

* For example: diff --git a/src/main/java/jenkins/scm/api/mixin/ChangeRequestSCMHead2.java b/src/main/java/jenkins/scm/api/mixin/ChangeRequestSCMHead2.java index 27328852..861499f4 100644 --- a/src/main/java/jenkins/scm/api/mixin/ChangeRequestSCMHead2.java +++ b/src/main/java/jenkins/scm/api/mixin/ChangeRequestSCMHead2.java @@ -29,7 +29,7 @@ import jenkins.scm.api.SCMSource; /** - * Additionl attributes of a {@link ChangeRequestSCMHead} that should have been in the original mixin but we are not + * Additional attributes of a {@link ChangeRequestSCMHead} that should have been in the original mixin but we are not * targeting Java 8 so we cannot add the default methods to the interface and must have an ugly {@code 2} class instead. * @since 2.2.0 */ diff --git a/src/main/java/jenkins/scm/api/trait/SCMHeadAuthority.java b/src/main/java/jenkins/scm/api/trait/SCMHeadAuthority.java index 920068a9..02b9db6a 100644 --- a/src/main/java/jenkins/scm/api/trait/SCMHeadAuthority.java +++ b/src/main/java/jenkins/scm/api/trait/SCMHeadAuthority.java @@ -39,7 +39,7 @@ import jenkins.scm.api.mixin.SCMHeadMixin; /** - * Abstraction to allow plugable definitions of trust for {@link SCMHead} and {@link SCMRevision} instances in the + * Abstraction to allow pluggable definitions of trust for {@link SCMHead} and {@link SCMRevision} instances in the * context of a specific {@link SCMSourceRequest}. *

* Note: there can be multiple authorities for the same types of head / revision active in the context of any one @@ -78,7 +78,7 @@ public final boolean isApplicableTo(@NonNull SCMRevision revision) { * Checks if this authority is relevant to the supplied {@link SCMSourceRequest}. * * @param request the supplied {@link SCMSourceRequest}. - * @return {@code true} if and only if this authority can provide trust information for the supplied requesy. + * @return {@code true} if and only if this authority can provide trust information for the supplied request. */ public final boolean isApplicableTo(@NonNull SCMSourceRequest request) { return getDescriptor().isApplicableToRequest(request); @@ -166,7 +166,7 @@ public SCMHeadAuthorityDescriptor getDescriptor() { } /** - * Retursn the subset of {@link SCMHeadAuthorityDescriptor} instances applicable to the supplied criteria. + * Returns the subset of {@link SCMHeadAuthorityDescriptor} instances applicable to the supplied criteria. * * @param requestClass the {@link SCMSourceRequest} class (or {@code null} to match any). * @param headClass the {@link SCMHeadMixin} class (or {@code null} to match any). diff --git a/src/main/java/jenkins/scm/api/trait/SCMHeadAuthorityDescriptor.java b/src/main/java/jenkins/scm/api/trait/SCMHeadAuthorityDescriptor.java index 9fad03ea..7b2fe220 100644 --- a/src/main/java/jenkins/scm/api/trait/SCMHeadAuthorityDescriptor.java +++ b/src/main/java/jenkins/scm/api/trait/SCMHeadAuthorityDescriptor.java @@ -56,7 +56,7 @@ public abstract class SCMHeadAuthorityDescriptor extends Descriptor revisionClass; /** - * Constructor to use when type inferrence using {@link #SCMHeadAuthorityDescriptor()} does not work. + * Constructor to use when type inference using {@link #SCMHeadAuthorityDescriptor()} does not work. * * @param clazz Pass in the type of {@link SCMHeadAuthority} * @param requestClass the type of {@link SCMSourceRequest}. diff --git a/src/main/java/jenkins/scm/api/trait/SCMNavigatorRequest.java b/src/main/java/jenkins/scm/api/trait/SCMNavigatorRequest.java index b2d21275..202f0ef3 100644 --- a/src/main/java/jenkins/scm/api/trait/SCMNavigatorRequest.java +++ b/src/main/java/jenkins/scm/api/trait/SCMNavigatorRequest.java @@ -195,7 +195,7 @@ public final boolean isExcluded(@NonNull String projectName) throws IOException, * @return {@code true} if and only if the request is completed, {@code false} if the request can process * additional named projects. * @throws IllegalArgumentException if the attribute factory provides attribute names that are unrecognized, or - * repeats already added attribues. + * repeats already added attributes. * @throws IOException if there is an I/O error. * @throws InterruptedException if the operation was interrupted. */ @@ -221,7 +221,7 @@ public boolean process(@NonNull String projectName, @NonNull SourceLambda source * @return {@code true} if and only if the request is completed, {@code false} if the request can process * additional named projects. * @throws IllegalArgumentException if an attribute factory provides attribute names that are unrecognized, or - * repeats already added attribues. + * repeats already added attributes. * @throws IOException if there is an I/O error. * @throws InterruptedException if the operation was interrupted. */ diff --git a/src/main/java/jenkins/scm/api/trait/SCMNavigatorTraitDescriptor.java b/src/main/java/jenkins/scm/api/trait/SCMNavigatorTraitDescriptor.java index cb796b7f..f2e9de71 100644 --- a/src/main/java/jenkins/scm/api/trait/SCMNavigatorTraitDescriptor.java +++ b/src/main/java/jenkins/scm/api/trait/SCMNavigatorTraitDescriptor.java @@ -39,7 +39,7 @@ public abstract class SCMNavigatorTraitDescriptor extends SCMTraitDescriptor { /** - * Constructor to use when type inferrence using {@link #SCMNavigatorTraitDescriptor()} does not work. + * Constructor to use when type inference using {@link #SCMNavigatorTraitDescriptor()} does not work. * * @param clazz Pass in the type of {@link SCMNavigatorTrait} */ diff --git a/src/main/java/jenkins/scm/api/trait/SCMSourceRequest.java b/src/main/java/jenkins/scm/api/trait/SCMSourceRequest.java index d98d6a01..4b078e90 100644 --- a/src/main/java/jenkins/scm/api/trait/SCMSourceRequest.java +++ b/src/main/java/jenkins/scm/api/trait/SCMSourceRequest.java @@ -478,7 +478,7 @@ SCMSourceCriteria.Probe create(@NonNull H head, @Nullable I revisionInfo) * and {@link SCMRevision} instances. *

* Some {@link SCMRevision} instances may be expensive to instantiate, for example a {@link ChangeRequestSCMHead2} - * may need to get the effective merge revision in order to comply with the equality and "offline" requirememt + * may need to get the effective merge revision in order to comply with the equality and "offline" requirement * of a {@link SCMRevision} which could require either asking the remote server or performing a local trial merge. * As this type of operation is only required if the {@link SCMHead} actually meets the {@link SCMSourceCriteria} * it may be preferred to delay instantiation of the {@link SCMRevision} and instead create the diff --git a/src/main/java/jenkins/scm/api/trait/SCMSourceTraitDescriptor.java b/src/main/java/jenkins/scm/api/trait/SCMSourceTraitDescriptor.java index 4ee3a07d..04375611 100644 --- a/src/main/java/jenkins/scm/api/trait/SCMSourceTraitDescriptor.java +++ b/src/main/java/jenkins/scm/api/trait/SCMSourceTraitDescriptor.java @@ -37,7 +37,7 @@ public abstract class SCMSourceTraitDescriptor extends SCMTraitDescriptor { /** - * Constructor to use when type inferrence using {@link #SCMSourceTraitDescriptor()} does not work. + * Constructor to use when type inference using {@link #SCMSourceTraitDescriptor()} does not work. * * @param clazz Pass in the type of {@link SCMTrait} */ diff --git a/src/main/java/jenkins/scm/api/trait/SCMTraitDescriptor.java b/src/main/java/jenkins/scm/api/trait/SCMTraitDescriptor.java index d5fb9ace..000b6c2e 100644 --- a/src/main/java/jenkins/scm/api/trait/SCMTraitDescriptor.java +++ b/src/main/java/jenkins/scm/api/trait/SCMTraitDescriptor.java @@ -39,7 +39,7 @@ public abstract class SCMTraitDescriptor> extends Descript // Constructors are package private in order to restrict trait specializations to the ones defined in this plugin /** - * Constructor to use when type inferrence using {@link #SCMTraitDescriptor()} does not work. + * Constructor to use when type inference using {@link #SCMTraitDescriptor()} does not work. * * @param clazz Pass in the type of {@link SCMTrait} */ diff --git a/src/main/resources/jenkins/scm/api/form/traits.jelly b/src/main/resources/jenkins/scm/api/form/traits.jelly index 1ad73ab3..8077a755 100644 --- a/src/main/resources/jenkins/scm/api/form/traits.jelly +++ b/src/main/resources/jenkins/scm/api/form/traits.jelly @@ -25,7 +25,7 @@ THE SOFTWARE. - + Data-bound only version of <f:hetero-list> specialized for traits. diff --git a/src/test/java/jenkins/scm/impl/SingleSCMSourceTest.java b/src/test/java/jenkins/scm/impl/SingleSCMSourceTest.java index 5c6ec8fa..4a9e809f 100644 --- a/src/test/java/jenkins/scm/impl/SingleSCMSourceTest.java +++ b/src/test/java/jenkins/scm/impl/SingleSCMSourceTest.java @@ -132,7 +132,7 @@ public void given_instance_when_fetch_then_revisionObserved() throws Exception { } @Test - public void given_instance_when_fetchWithCriterial_then_criteriaIgnoredAndRevisionObserved() throws Exception { + public void given_instance_when_fetchWithCriteria_then_criteriaIgnoredAndRevisionObserved() throws Exception { MockSCMController c = MockSCMController.create(); try { c.createRepository("foo");