<commit_before>#  Development Environment Setup

## Setup

You will need to install these tools on your machine:

### macOS

 - [Node.js v8.9.0](https://nodejs.org/dist/v8.9.0/)
 - [Python 2.7](https://www.python.org/downloads/mac-osx/)
 - Xcode and Xcode Command Line Tools (Xcode -> Preferences -> Downloads)

### Windows

 - [Node.js v8.9.0](https://nodejs.org/dist/v8.9.0/)
    - *Make sure you allow the Node.js installer to add node to the PATH.*
 - [Python 2.7](https://www.python.org/downloads/windows/)
    - *Let Python install into the default suggested path (`c:\Python27`), otherwise you'll have
      to configure node-gyp manually with the path which is annoying.*
    - *Ensure the **Add python.exe to Path** option is selected.*
 - Visual Studio 2015 or [Visual C++ Build Tools](http://go.microsoft.com/fwlink/?LinkId=691126)
    - *If you already have Visual Studio 2015 installed, ensure you have the **Common Tools for Visual C++ 2015**
      feature as that is required by Node.js for installing native modules.*
    - *Visual Studio 2017 support has not been tested yet - see [#1766](https://github.com/desktop/desktop/issues/1766) for details*
 - *Run `npm config set msvs_version 2015` to tell node the right toolchain to use for compiling native modules.*

### Fedora 26

First, add the NodeJS package repository. As this version of Fedora doesn't support v7, you'll need to use v8:

```shellsession
$ curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
```

After that, install the dependencies to build and test the app:

```shellsession
$ sudo dnf install -y nodejs gcc-c++ make libsecret-devel libXScrnSaver
```

If you want to package Desktop for distribution, you will need these additional dependencies:

```shellsession
$ sudo dnf install fakeroot dpkg rpm rpm-build xz xorriso appstream bzip2-devel
```

If you have problems packaging for AppImage, you may need to force the linker to use the right
version of specific dependencies. More information [here](https://michaelheap.com/error-while-loading-shared-libraries-libbz2-so-1-0-cannot-open-shared-object-file-on-centos-7)
and [here](https://github.com/electron-userland/electron-builder/issues/993#issuecomment-291021974)

```shellsession
$ sudo ln -s `find /usr/lib64/ -type f -name "libbz2.so.1*"` /usr/lib64/libbz2.so.1.0
$ sudo ln -s `find /usr/lib64/ -type f -name "libreadline.so.7.0"` /usr/lib64/libreadline.so.6
```<commit_msg>last mention of v7<commit_after>#  Development Environment Setup

## Setup

You will need to install these tools on your machine:

### macOS

 - [Node.js v8.9.0](https://nodejs.org/dist/v8.9.0/)
 - [Python 2.7](https://www.python.org/downloads/mac-osx/)
 - Xcode and Xcode Command Line Tools (Xcode -> Preferences -> Downloads)

### Windows

 - [Node.js v8.9.0](https://nodejs.org/dist/v8.9.0/)
    - *Make sure you allow the Node.js installer to add node to the PATH.*
 - [Python 2.7](https://www.python.org/downloads/windows/)
    - *Let Python install into the default suggested path (`c:\Python27`), otherwise you'll have
      to configure node-gyp manually with the path which is annoying.*
    - *Ensure the **Add python.exe to Path** option is selected.*
 - Visual Studio 2015 or [Visual C++ Build Tools](http://go.microsoft.com/fwlink/?LinkId=691126)
    - *If you already have Visual Studio 2015 installed, ensure you have the **Common Tools for Visual C++ 2015**
      feature as that is required by Node.js for installing native modules.*
    - *Visual Studio 2017 support has not been tested yet - see [#1766](https://github.com/desktop/desktop/issues/1766) for details*
 - *Run `npm config set msvs_version 2015` to tell node the right toolchain to use for compiling native modules.*

### Fedora 26

First, add the NodeJS package repository.

```shellsession
$ curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
```

After that, install the dependencies to build and test the app:

```shellsession
$ sudo dnf install -y nodejs gcc-c++ make libsecret-devel libXScrnSaver
```

If you want to package Desktop for distribution, you will need these additional dependencies:

```shellsession
$ sudo dnf install fakeroot dpkg rpm rpm-build xz xorriso appstream bzip2-devel
```

If you have problems packaging for AppImage, you may need to force the linker to use the right
version of specific dependencies. More information [here](https://michaelheap.com/error-while-loading-shared-libraries-libbz2-so-1-0-cannot-open-shared-object-file-on-centos-7)
and [here](https://github.com/electron-userland/electron-builder/issues/993#issuecomment-291021974)

```shellsession
$ sudo ln -s `find /usr/lib64/ -type f -name "libbz2.so.1*"` /usr/lib64/libbz2.so.1.0
$ sudo ln -s `find /usr/lib64/ -type f -name "libreadline.so.7.0"` /usr/lib64/libreadline.so.6
```
{'fraction_non_alphanumeric': 0.1246376811594203, 'fraction_numerical': 0.03706004140786749, 'mean_word_length': 3.8165503489531405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 16, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2729650', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1490, 'n_words': 528}