Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
davesag committed Oct 30, 2017
1 parent 444ddf8 commit e38675f
Show file tree
Hide file tree
Showing 9 changed files with 2,924 additions and 1 deletion.
92 changes: 92 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# How to contribute to this project

## Development Environment

All development is assumed to be done on a Mac running a modern version of OS X but ought to be pretty much the same no matter what unixy environment you use.

## Development Process

All development is to follow the [standard git-flow](http://nvie.com/posts/a-successful-git-branching-model/) process, modified to allow for code-reviews.

See this handy, if ugly, [cheat sheet](http://danielkummer.github.io/git-flow-cheatsheet/).

### Setup

1. Fork this repo into your personal GitHub account
2. clone your fork to your local development machine
3. Set this repo as the `upstream` repo `git remote add upstream <insert the upstream url>`
4. Disallow direct pushing to upstream `git remote set-url --push upstream no_push`
5. create a local `master` branch `git checkout -b master` and test it via `git pull upstream master`
6. ensure you have installed the [`git-flow` command line helpers](https://github.com/nvie/gitflow) and [`git-flow-completion` utils](https://github.com/bobthecow/git-flow-completion) then run `git flow init -d`.

#### Optional Git Setup

Set up `git` to always `rebase` rather than merge.

```sh
git config --global branch.autosetuprebase always
```

Make sure `git` knows you are using your correct email.

```sh
git config user.email "[email protected]"
```

### Working on new features

1. Create a "feature branch" for the change you wish to make via `git flow feature start {feature_name}`. See below for how to name features.
2. Now work on your changes locally until you are happy the issue is resolved. See below for how to name commit messages.
3. `git flow feature publish {feature_name}` will push it back up to your fork on GitHub.
4. Use `git flow feature pull {remote_name} {feature_name}` to bring in any other changes, If other people have also merged changes in, and you can't merge your PR automatically you'll need to `rebase` their changes into your changes and then `--force` push the resulting changes using standard `git` commands.
5. Use GitHub to raise a Pull Request. Add labels as appropriate, and set one or more reviewers. Then paste the url of the PR into the `#development` Slack channel with a request for someone to please review the changes. See below for how to name pull requests.
6. Respond to any comments as appropriate, making changes and `git push` ing further changes as appropriate.
7. When all comments are dealt and the PR finally gets a :+1: from someone else then merge the PR. _Note we will not be using the `git flow feature finish`_ option as that merges into develop automatically without the option for review. [see this stackexchange for more on that](http://programmers.stackexchange.com/questions/187723/code-review-with-git-flow-and-github).
8. In your command-line `git checkout develop` then `git pull upstream develop` to get the latest code and `git branch -D feature/{branchname}` to delete the old feature branch.

#### Hotfixes and Support branches

It's basically the same process but use the word `hotfix` or `support` instead of `feature`. `git flow` knows what to do. Just keep in mind that any changes are going to happen to your fork, and not the upstream repo. If you need to merge a `hotfix` into upstream master you may only do it va a reviewed pull request.

### Releasing to production

1. `git flow release start {tag.number}` (using semantic versioning)
2. commit any changes to version info in `package.json` then `git flow release publish {tag.number}`
3. `git flow release finish {tag.number}` merges the release into `master` of your fork, tags it, merges that back into `develop` on your fork and removes the release branch.
4. Now go back to GitHub and raise a Pull Request to merge the upstream master from your fork's `master` branch. When that goes through you are done.
5. In your command-line go back and clean up any outstanding branches and `git pull upstream` your local `master` and `develop` branches to ensure everything on your local machine is up to date with everyone's changes.

Note you will **never** push changes directly to the upstream project, *only to your own fork*.

**Changes may only be introduced into the upstream project via a properly reviewed pull request.**

## Naming things

There are various systems, including GitHub itself, which will pick up the issue numbers from commit messages and pull requests and automatically associate them with the issues. It is therefore desirable to use a formal naming scheme for features, commit messages and pull requests.

### Features

Features must be named per the following pattern `#{issue number}/{some_descriptive-text}` — so for example, if you are working on issue `ABC-1` with the title "do the thing", call your feature `ABC-1/do_the-thing`. Obviously use your common sense to avoid making the feature names too long.

Note this will creating a feature via `git flow` will create a branch called `feature/{issue number}/{some_descriptive-text}`.

### Commit Messages

When commiting something use the `-m` flag to add a short commit message of the format `{issue number} summary of what you changed`. So for example if you are working on issue `ABC-1` and you added a method to the `aardvark_controller` you might use the following commit message `"ABC-1 added anteater method to aardvark controller"`

Commit messages ought to be in the past tense.

In general try to group file changes wherever appropriate, so if your controller change also involved updating something in a helper file, the one commit message can happily encompas the changes to both files. The message ought to reflect the main aim of the change.

### Pull Requests

Pull requests must be named as follows `[issue type, issue number] high level description of change`. The following Issue Types are recognised

* `Bug Fix` - the change fixes a bug
* `Feature` - the change adds a new feature (the usual issue type)
* `Documentation` — The change is a documentation only change
* `Optimisation` - The change is an optimisation of the code base without any functional changes

If your change does not fit any of these categories, use `Feature`. Likewise if your change is not tied to an issue number you may use `n/a` instead.

So to use the above example your Pull Request would be named `[Feature, ABC-1] added anteater to aardvark`
36 changes: 36 additions & 0 deletions Preferences/Comments.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.sol</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>// </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_2</string>
<key>value</key>
<string>/*</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_2</string>
<key>value</key>
<string>*/</string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>A2110FD9-2C0E-4E2F-9F73-FF5C30DFBC5D</string>
</dict>
</plist>
21 changes: 21 additions & 0 deletions Preferences/Solidity Indent.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Solidity Indent</string>
<key>scope</key>
<string>source.sol</string>
<key>settings</key>
<dict>
<key>bracketIndentNextLinePattern</key>
<string>(?x) ^ \s* \b(if|while|else)\b [^;]* $ | ^ \s* \b(for)\b .* $</string>
<key>decreaseIndentPattern</key>
<string>^(.*\*/)?\s*[}].*$</string>
<key>increaseIndentPattern</key>
<string>^.*\{[^}"']*$</string>
</dict>
<key>uuid</key>
<string>13886687-733F-425E-9FD8-AEF9741B18FF</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Preferences/Symbol List Banned.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List Banned</string>
<key>scope</key>
<string>source.sol meta.function-call, source.sol meta.instance.constructor</string>
<key>settings</key>
<dict>
<key>showInIndexedSymbolList</key>
<string>1</string>
<key>showInSymbolList</key>
<string>0</string>
</dict>
<key>uuid</key>
<string>2C865982-45DA-49F0-977D-FF22585FEFC9</string>
</dict>
</plist>
23 changes: 23 additions & 0 deletions Preferences/Symbol List Function.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List Function</string>
<key>scope</key>
<string>
source.sol meta.function, source.sol meta.contract.sol
</string>
<key>settings</key>
<dict>
<key>showInIndexedSymbolList</key>
<string>1</string>
<key>showInSymbolList</key>
<string>1</string>
<key>symbolTransformation</key>
<string>s/\s+/ /g;</string>
</dict>
<key>uuid</key>
<string>48592C2A-69EA-4CB7-AA0F-9661E236FB66</string>
</dict>
</plist>
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# Solidity.tmbundle
A TextMate 2 compatible language bundle for Solidity

A [TextMate 2](https://macromates.com) compatible language bundle for [Solidity](http://solidity.readthedocs.io).

*Note*: _this is very much a draft._

## To Install

Clone this repo and then in the finder double click the *Solidity.tmbundle* bundle.
TextMate will then offer to install it.

## To Contribute

Contributions are encouraged. See [CONTRIBUTING](CONTRIBUTING.md) for more details.

## License

MIT License

Loading

0 comments on commit e38675f

Please sign in to comment.