-
Notifications
You must be signed in to change notification settings - Fork 15
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
docs: add docs related to contributing #171
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
4bd45e5
docs: add contributing doc, principles doc
liammulh 31e96fd
docs: add more work on contributing
liammulh 530b0f9
docs: address feedback in linked PR
liammulh 65dd277
docs: add content from old contributing doc
liammulh a59cd05
docs: remove old contributing doc
liammulh 9b4f869
docs: move some docs to separate files
liammulh 13931ed
docs: fix link to contributing in README
liammulh 5107eab
docs: fix link in onboarding doc, remove old PR file
liammulh 5900989
docs: add red circle to PR image
liammulh 2493cc5
docs: remove old code style doc, add new one
liammulh e1c8924
docs: fix links in Git issue flowchart doc
liammulh 72ffa5c
docs: fix formatting in Git issues flowchart doc
liammulh 4032495
docs: remove stray - in flowchart doc
liammulh 496c64c
docs: add goal to git scenarios doc
liammulh 4f38f81
docs: add note about Git scenarios to contrib doc
liammulh 6294e3a
docs: clarify correct scenarios in scenarios doc
liammulh 7a08b13
docs: add correct setup congrats, fix links
liammulh b95df1f
docs: add timestamp to PR checklist comments
liammulh 8c5ac25
docs: clarify `git stash` commands
liammulh 4d7ced0
docs: add section on checking remotes
liammulh 7187a2f
docs: add contributing doc to docsite sidebar
liammulh b354337
docs: move more items into sidebar, change titles
liammulh 6f12825
docs: get rid of checkboxes in PR checklist
liammulh e0bcd94
docs: fix link in extending doc
liammulh f68dccf
docs: advertise onboarding doc in contrib doc
liammulh 54a1ed2
docs: make onboarding second item in sidebar
liammulh 5fce879
docs: emphasize correct Git setup in onboarding doc
liammulh d4fe70d
docs: shorten name of Git scenarios doc
liammulh 960b52d
docs: add index into array to code principles doc
liammulh 897e6e2
docs: say code formatting instead of code style
liammulh bdece07
docs: add bullet point to PR checklist
liammulh fe10192
docs: put working with PM above git/github in sidebar
liammulh d61fdff
refactor: put gitting it right doc in doc dir
liammulh 700ddca
doc(Code Principles): Make the two subheaders parallel
gwhitney 1f70901
doc(Code Style): remove slightly redundant language
gwhitney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Contributing to Numberscope | ||
|
||
## If you are new to software development and like written guides... | ||
|
||
Read our [onboarding doc](./doc/onboarding.md). | ||
|
||
## If you are new to software development and like videos... | ||
|
||
Watch the video series on contributing to Numberscope | ||
[here](https://www.youtube.com/playlist?list=PLA4KIQBQQRb5ccOdr9v0iLw_fKHup1PkU). | ||
This video series will introduce you to Numberscope, GitHub, the software we | ||
use in the Numberscope project, and the workflow for contributing to | ||
Numberscope. | ||
|
||
## If you are experienced, follow these steps... | ||
|
||
(This assumes you're working on the numberscope/frontscope repository, but it | ||
applies to other repos as well.) | ||
|
||
1. [Create a fork of the numberscope/frontscope repo](./doc/working-with-git-and-github.md#create-a-fork). | ||
2. [Clone your fork of numberscope/frontscope](./doc/working-with-git-and-github.md#clone-a-repo). | ||
3. [Create a branch for your contribution](./doc/working-with-git-and-github.md#create-a-branch). | ||
4. [Read about basic Git operations](./doc/working-with-git-and-github.md#basic-git-operations). | ||
5. [Push your branch to GitHub](./doc/working-with-git-and-github.md#push-a-branch). | ||
6. [Read Numberscope's coding principles guide](./doc/code-principles.md). | ||
7. [Read Numberscope's style guide](./doc/code-style.md). | ||
8. [Work through Numberscope's pull request checklist](./doc/pull-request-checklist.md). | ||
9. [Submit a pull request](./doc/working-with-git-and-github.md#submit-a-pull-request). | ||
|
||
## If you need help with Git and contributing... | ||
|
||
If you have a Git setup that isn't what Numberscope requires (i.e. do your | ||
work in your own fork on a feature branch) check out our doc on | ||
[Gitting it right](./doc/gitting-it-right.md). | ||
|
||
## A note on code organization | ||
|
||
The Numberscope system actually comprises two code repositories. This | ||
documentation is generated from the one called `frontscope` | ||
([GitHub](https://github.com/numberscope/frontscope)), and is primarily | ||
concerned with the operation and development of that portion of the system. | ||
|
||
The code in this `frontscope` repository is responsible for defining and | ||
displaying the visualizers, and for establishing how to specify the sequences | ||
the visualizers act on. In general, it provides Numberscope's user interface. | ||
|
||
If you need to deal with the code responsible for retrieving integer sequences | ||
from the [Online Encyclopedia of Integer Sequences (OEIS)](https://oeis.org/), | ||
or for performing the computations involved in generating sequence entries and | ||
their factorizations, see `backscope` | ||
([GitHub](https://github.com/numberscope/backscope)). | ||
|
||
## Submit a pull request | ||
|
||
(This assumes you're working on the numberscope/frontscope repository, but it | ||
applies to other repos as well.) | ||
|
||
If you've read the | ||
[Numberscope code principles guide](./doc/code-principles.md) and the | ||
[Numberscope code style guide](./doc/code-style.md), and you think your code | ||
is ready to be reviewed by someone at Numberscope, follow these steps: | ||
|
||
1. Work through | ||
[Numberscope's pull request checklist](./doc/pull-request-checklist.md). | ||
2. Sync your fork with the main numberscope/frontscope repository. The easiest | ||
way to do this is to navigate to the page of your fork of | ||
numberscope/frontscope and click "Sync fork" (see the picture below). | ||
![A screenshot of the Sync fork option](./doc/img/sync-fork.png) Another | ||
way to do this is to | ||
[add numberscope/frontscope as a remote](#add-a-remote) and | ||
[sync your fork with the remote original](#sync-local-fork-with-remote-original). | ||
3. Navigate to the numberscope/frontscope repository. If your fork is synced | ||
up with the main numberscope/frontscope repository correctly, you should | ||
see a button (see the image below) that says "Compare & pull request". | ||
![A screenshot of the Compare & pull request | ||
button](./doc/img/compare-and-pull-request.png) | ||
Click that button, write up some notes for your pull request, and click the | ||
"Create pull request button". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Code principles | ||
|
||
There are two acronyms that can help you write better code. | ||
|
||
## DRY (Don't Repeat Yourself) | ||
|
||
Practically speaking, this means: | ||
|
||
- create function or use a loop instead of copying and pasting blocks of | ||
code | ||
- use a variable instead of typing the same value multiple times | ||
- use your libraries instead of writing something from scratch | ||
- use pre-existing solutions instead of writing something from scratch | ||
- use a loop or index into an array instead of writing long conditional | ||
(`if`/`elif`/`else`) blocks or switch statements | ||
|
||
## KISS (Keep It Short (and) Simple) | ||
|
||
Practically speaking this means: | ||
|
||
- name your functions so that we know what they do | ||
- name your variables so that we know what they are | ||
- write your functions so that they only have one responsibility | ||
- write your functions so that they don't have too many side effects | ||
- write short functions (you should be able to read the function without | ||
having to scroll your screen) | ||
- write comments that help the reader understand your code instead of | ||
comments that merely repeat what the code already says | ||
- only have code that actually does something -- don't include any commented | ||
out code or code that can't be reached or run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Code style | ||
|
||
Outside of the code formatting that is covered by our automated tools (ESLint | ||
and Prettier as of this writing), we also like to: | ||
|
||
# Minimize the number of return statements in a function | ||
|
||
- If you can easily figure out that you need to bail out of a function, go | ||
ahead and put a return at the top of the function and then proceed with | ||
the rest of the function. | ||
- Otherwise, try to minimize the number of return statements in a function. | ||
Having them strewn throughout a function (especially a long function) is | ||
generally hard to read. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Gitting it right | ||
|
||
If you find yourself with a Git setup that isn't what Numberscope requires | ||
(i.e. do your work in your own fork on a feature branch), you might be able to | ||
use this guide to fix your setup. | ||
|
||
Here are the different scenarios you could find yourself in and what to do | ||
about them. | ||
|
||
- 1: You have a clone of a Numberscope repository. | ||
- 1.A: You haven't made changes. | ||
- [Create a fork](./working-with-git-and-github.md#create-a-fork). | ||
- [Clone your fork](./working-with-git-and-github.md#clone-a-repo). | ||
- [Create a branch](./working-with-git-and-github.md#create-a-branch). | ||
- [Push a branch](./working-with-git-and-github.md#push-a-branch). | ||
- Now you are working in your own fork on a dedicated feature | ||
branch, congrats! Read about about basic Git operations below and | ||
get to work making a cool visualizer! | ||
- [Read about basic Git operations](./working-with-git-and-github.md#basic-git-operations). | ||
- 1.B: You have made changes. | ||
- 1.B.1: You are working on the main branch. | ||
- 1.B.1.A: You made commits. | ||
- Ask someone at Numberscope for help | ||
- 1.B.1.B: You haven't made commits. | ||
- [Stash your changes](./working-with-git-and-github.md#stash-your-changes). | ||
- [Create a branch](./working-with-git-and-github.md#create-a-branch). | ||
- [Create a fork](./working-with-git-and-github.md#create-a-fork). | ||
- [Add the remote of your fork](./working-with-git-and-github.md#add-a-remote). | ||
- [Push the branch to your fork](./working-with-git-and-github.md#push-a-branch). | ||
- [Clone your fork](./working-with-git-and-github.md#clone-a-repo). | ||
- Now you are working in your own fork on a dedicated feature | ||
branch, congrats! Read about about basic Git operations below | ||
and get to work making a cool visualizer! | ||
- [Read about basic Git operations](./working-with-git-and-github.md#basic-git-operations). | ||
- 1.B.2: You are working on a different branch. | ||
- 1.B.2.A: You have made commits. | ||
- [Create a fork](./working-with-git-and-github.md#create-a-fork). | ||
- [Add the remote of your fork](./working-with-git-and-github.md#add-a-remote). | ||
- [Push the branch to your fork](./working-with-git-and-github.md#push-a-branch). | ||
- [Clone your fork](./working-with-git-and-github.md#clone-a-repo). | ||
- Now you are working in your own fork on a dedicated | ||
feature branch, congrats! Read about about basic Git | ||
operations below and get to work making a cool visualizer! | ||
- [Read about basic Git operations](./working-with-git-and-github.md#basic-git-operations). | ||
- 1.B.2.B: You haven't made commits. | ||
- [Commit your changes](./working-with-git-and-github.md#commit-changes). | ||
- [Create a fork](./working-with-git-and-github.md#create-a-fork). | ||
- [Add the remote of your fork](./working-with-git-and-github.md#add-a-remote). | ||
- [Push the branch to your fork](./working-with-git-and-github.md#push-a-branch). | ||
- [Clone your fork](./working-with-git-and-github.md#clone-a-repo). | ||
- Now you are working in your own fork on a dedicated | ||
feature branch, congrats! Read about about basic Git | ||
operations below and get to work making a cool visualizer! | ||
- [Read about basic Git operations](./working-with-git-and-github.md#basic-git-operations). | ||
- 2: You have a fork of a Numberscope repository. | ||
- 2.A: You haven't made changes. | ||
- [Clone your fork](./working-with-git-and-github.md#clone-a-repo) | ||
(if you don't have it on your computer yet). | ||
- [Create a branch](./working-with-git-and-github.md#create-a-branch). | ||
- [Push a branch](./working-with-git-and-github.md#push-a-branch). | ||
- Now you are working in your own fork on a dedicated feature | ||
branch, congrats! Read about about basic Git operations below and | ||
get to work making a cool visualizer! | ||
- [Read about basic Git operations](./working-with-git-and-github.md#basic-git-operations). | ||
- 2.B: You have made changes. | ||
- 2.B.1: You are working on the main branch. | ||
- 2.B.1.A: You made commits. | ||
- Ask someone at Numberscope for help. | ||
- 2.B.1.B: You haven't made commits. | ||
- [Stash your changes](./working-with-git-and-github.md#stash-your-changes). | ||
- [Create a branch](./working-with-git-and-github.md#create-a-branch). | ||
- [Unstash your changes](./working-with-git-and-github.md#unstash-your-changes). | ||
- [Push a branch](./working-with-git-and-github.md#push-a-branch). | ||
- Now you are working in your own fork on a dedicated | ||
feature branch, congrats! Read about about basic Git | ||
operations below and get to work making a cool visualizer! | ||
- [Read about basic Git operations](./working-with-git-and-github.md#basic-git-operations). | ||
- 2.B.2: You are working on a different branch. | ||
- 2.B.2.A: You have made commits. | ||
- This is the correct setup! Congrats. Feel free to | ||
[read about basic Git operations](./working-with-git-and-github.md#basic-git-operations). | ||
- Keep working in this fashion. | ||
- 2.B.2.B: You haven't made commits. | ||
- [Commit your changes](./working-with-git-and-github.md#commit-changes). | ||
- Now you are working in your own fork on a dedicated | ||
feature branch, congrats! Read about about basic Git | ||
operations below and get to work making a cool visualizer! | ||
- [Read about basic Git operations](./working-with-git-and-github.md#basic-git-operations). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Pull request checklist | ||
|
||
## For PR submitters | ||
|
||
The PR submitter should: | ||
|
||
- Write or supplement test(s) for the file(s) you touch in your PR. | ||
- Make sure Numberscope runs properly, including former supposedly | ||
unmodified behaviors and newly implemented ones. In particular, run it via | ||
'npm run dev' and with the browser console open and make sure there are no | ||
log messages from Numberscope code, warnings, or errors. | ||
- Read over the reviewer checklist and try to make sure in advance that your | ||
code is going to proceed as smoothly through the review as possible. | ||
|
||
## For PR reviewers | ||
|
||
- All new or changed features are appropriately documented. | ||
- Tests are appropriately modified for all new or changed features. | ||
- The PR is passing lint by running `npm run lint`. There should be no | ||
changed files and no warnings/errors. | ||
- The PR builds by running `npm run build`. (This also checks type | ||
correctness.) There should be no errors, and for now the only allowed | ||
warning is the one about some assets being too big. | ||
- The PR passes all tests. Right now (Oct. 2022), just by running | ||
`npm run test:unit`. | ||
- Numberscope runs properly -- basically the same check as on the submitter | ||
list, but be sure to exercise as many randomly selected behaviors as you | ||
have time for, definitely including but not limited to the ones nominally | ||
affected by the PR. This should be done in `npm run preview` mode after a | ||
successful build. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the screenshots!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :)