Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #59

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down
8 changes: 4 additions & 4 deletions docs/consumer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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.

Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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`.
+
Expand Down
8 changes: 4 additions & 4 deletions docs/implementation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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_`.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1102,7 +1102,7 @@ public class MyChangeRequestSCMRevision extends ChangeRequestSCMRevision<MySCMHe
----

To enable consumers to establish the relationship between revisions and heads, you should implement the `SCMSource.parentRevisions(_head_,_revision_,_listener_)` and `SCMSource.parentHeads(_head_,_listener_)` methods.
These two methods are not strictly _required_, but when implemented they enable consumers to identify relationships between different branches, e.g. if the consumer wants to build a more complete changelong history tracking through the different branches.
These two methods are not strictly _required_, but when implemented they enable consumers to identify relationships between different branches, e.g. if the consumer wants to build a more complete changelog history tracking through the different branches.

=== Implementing `jenkins.scm.api.SCMNavigator`

Expand Down Expand Up @@ -1522,7 +1522,7 @@ if ("branch-create".equals(event)) {
} // else etc
----

Because each event from the source control system has a 1:1 correspondance with the events in the SCM API the implementation of each event can be fairly straightforward:
Because each event from the source control system has a 1:1 correspondence with the events in the SCM API the implementation of each event can be fairly straightforward:

[source,java]
----
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jenkins/scm/api/SCMEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public String description() {
* <strong>The {@link Cause} instances should probably be new instances each time, see
* {@link Cause#onAddedTo(Run)}.</strong>
*
* @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() {
Expand Down Expand Up @@ -406,7 +406,7 @@ public enum Type {
* <ul>
* <li>An existing {@link SCMNavigator} getting a new {@link SCMSource} would trigger a
* {@link SCMSourceEvent}</li>
* <li>An existing {@link SCMSource} gettings a new {@link SCMHead} would trigger a {@link SCMHeadEvent}</li>
* <li>An existing {@link SCMSource} getting a new {@link SCMHead} would trigger a {@link SCMHeadEvent}</li>
* </ul>
*/
CREATED,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/jenkins/scm/api/SCMSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
* <p>
* For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/jenkins/scm/api/trait/SCMHeadAuthority.java
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
* <p>
* Note: there can be multiple authorities for the same types of head / revision active in the context of any one
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public abstract class SCMHeadAuthorityDescriptor extends Descriptor<SCMHeadAutho
private final Class<? extends SCMRevision> 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}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public abstract class SCMNavigatorTraitDescriptor extends SCMTraitDescriptor<SCMNavigatorTrait> {

/**
* 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}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ SCMSourceCriteria.Probe create(@NonNull H head, @Nullable I revisionInfo)
* and {@link SCMRevision} instances.
* <p>
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
public abstract class SCMSourceTraitDescriptor extends SCMTraitDescriptor<SCMSourceTrait> {

/**
* 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}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class SCMTraitDescriptor<T extends SCMTrait<T>> 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}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/jenkins/scm/api/form/traits.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:f="/lib/form" xmlns:local="local">
<!-- TODO switch to hetero-list or repoeatableHeteroProperty once the dd-handle class can be removed -->
<!-- TODO switch to hetero-list or repeatableHeteroProperty once the dd-handle class can be removed -->
<st:documentation>
Data-bound only version of &lt;f:hetero-list&gt; specialized for traits.
<st:attribute name="field" use="required">
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/jenkins/scm/impl/SingleSCMSourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down