Skip to content

Commit

Permalink
Improve and document using Codespaces and Devcontainers (#6539)
Browse files Browse the repository at this point in the history
* Rename file

* Add bootstrap

* Use onCreateCommand.sh

* Dcoument using codespaces and devcontainers

* Use link from GitHub UI

* Add button to README.md
  • Loading branch information
lildude authored Sep 13, 2023
1 parent fd79827 commit 6b349cf
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
]
}
},
"onCreateCommand": "./script/bootstrap",
"postCreateCommand": ".devcontainer/postCreate.sh",
"onCreateCommand": ".devcontainer/onCreateCommand.sh",
"remoteUser": "vscode"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
./script/bootstrap
git remote add linguist https://github.com/github-linguist/linguist
git fetch linguist v2.0.0:v2.0.0 test/attributes:test/attributes test/master:test/master
28 changes: 26 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,31 @@ By participating, you are expected to uphold this code.

The majority of contributions won't need to touch any Ruby code at all.

## Dependencies
## Setting up a working environment

In order to start contributing to Linguist, you will need to setup your working environment.
We detail three methods below and recommend using GitHub Codespaces as it is the easiest and quickest method that will provide you with a consistent pre-configured environment ready for you to start contributing.

### Using GitHub Codespaces

Using GitHub Codespaces is the easiest and quickest method to start contributing.
The Free and Pro plans for personal accounts include free use of GitHub Codespaces up to a fixed amount of usage every month.
For more info on GitHub Codespaces billing, see [this help page](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces).

To get started, click this button: [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/github-linguist/linguist)

### Using the dev container locally

To open locally in VS Code using a dev container, follow the [Visual Studio Code Dev Containers installation instructions](https://code.visualstudio.com/docs/remote/containers#_installation) to configure dev container support.
Close the repo and open it in VS Code.
VS Code will automatically offer to run this project in a dev container when the project is opened.
No additional setup will be required.

### Using your local system without the dev container

This is the longest and most involved and error-prone approach and is documented for those who can't use one of the methods above or prefer to do everything within the native operating system environment.

#### Dependencies

Linguist is a Ruby library so you will need a recent version of Ruby installed.
There are known problems with the macOS/XCode supplied version of Ruby that causes problems installing some of the dependencies.
Expand All @@ -32,7 +56,7 @@ apt-get install cmake pkg-config libicu-dev docker.io ruby ruby-dev zlib1g-dev b

The latest version of Bundler can be installed with `gem install bundler`.

## Getting started
#### Getting started

Before you can start contributing to Linguist, you'll need to set up your environment first.
Clone the repo and run `script/bootstrap` to install its dependencies.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Linguist

[![Actions Status](https://github.com/github/linguist/workflows/Run%20Tests/badge.svg)](https://github.com/github/linguist/actions)
[![Actions Status](https://github.com/github/linguist/workflows/Run%20Tests/badge.svg)](https://github.com/github/linguist/actions)

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/github-linguist/linguist)

This library is used on GitHub.com to detect blob languages, ignore binary or vendored files, suppress generated files in diffs, and generate language breakdown graphs.

Expand Down

0 comments on commit 6b349cf

Please sign in to comment.