From 941b47fb2c40d620ff3df5a79dd8b197acd024f6 Mon Sep 17 00:00:00 2001 From: Rak Laptudirm Date: Thu, 7 Oct 2021 21:28:15 +0530 Subject: [PATCH 1/3] chore: format fixes Tasks: - Removed author clause. - Updated external library guideline. --- CONTRIBUTING.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 38a263781a..d21030d1f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,15 +125,12 @@ function sumOfArray (arrayOfNumbers) { return (sum) } ``` -* * Avoid using global variables and avoid `==` * Please use `let` over `var` * Please refrain from using `console.log` or any other console methods * **Absolutely** don't use `alert` * We strongly recommend the use of ECMAScript 6 -* Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms +* Do not use external libraries * Most importantly: * **Be consistent in the use of these guidelines when submitting** * Happy coding! - -Writer [@itsvinayak](https://github.com/itsvinayak), May 2020. From 2b6cf1d56d5f7fc2ab140bf4fcc96e49f4b9004c Mon Sep 17 00:00:00 2001 From: Rak Laptudirm Date: Fri, 8 Oct 2021 13:42:52 +0530 Subject: [PATCH 2/3] feat: fix punctuation issues --- CONTRIBUTING.md | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d21030d1f5..64533b184a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,10 +44,10 @@ Algorithms should be packaged in a way that would make it easy for readers to pu Algorithms should: -* have intuitive class and function names that make their purpose clear to readers -* use JavaScript naming conventions and intuitive variable names to ease comprehension -* be flexible to take different input values -* raise JavaScript exceptions (RangeError, etc.) on erroneous input values +* have intuitive class and function names that make their purpose clear to readers. +* use JavaScript naming conventions and intuitive variable names to ease comprehension. +* be flexible to take different input values. +* raise JavaScript exceptions (RangeError, etc.) on erroneous input values. Algorithms in this repo should not be how-to examples for existing JavaScript packages. Instead, they should perform internal calculations or manipulations to convert input values into different output values. Those calculations or @@ -79,20 +79,20 @@ Please refrain from using `console` in your implementation AND test code. You can (and should!) run all tests locally before committing your changes: ```shell -npm test +$ npm test ``` If you want save some time and just run a specific test: ```shell # this will run any test file where the filename matches "koch" -npm test -- koch +$ npm test -- koch ``` You can also start Jest in "watch" mode: ```shell -npm test -- --watchAll +$ npm test -- --watchAll ``` This will run all tests and watch source and test files for changes. When a change is made, the tests will run again. @@ -105,7 +105,7 @@ To maximize the readability and correctness of our code, we require that new sub Before committing, please run ```shell -npm run style +$ npm run style ``` in order to apply the coding style (where it can be done automatically). If an error is shown, please figure out what's @@ -113,9 +113,9 @@ wrong, fix it and run standard again. A few (but not all) of the things to keep in mind: -* Use camelCase with the leading character as lowercase for identifier names (variables and functions) -* Names start with a letter -* Follow code indentation: Always use 2 spaces for indentation of code blocks +* Use camelCase with the leading character as lowercase for identifier names (variables and functions). +* Names start with a letter. +* Follow code indentation: Always use 2 spaces for indentation of code blocks: ```js function sumOfArray (arrayOfNumbers) { let sum = 0 @@ -125,12 +125,13 @@ function sumOfArray (arrayOfNumbers) { return (sum) } ``` -* Avoid using global variables and avoid `==` -* Please use `let` over `var` -* Please refrain from using `console.log` or any other console methods -* **Absolutely** don't use `alert` -* We strongly recommend the use of ECMAScript 6 -* Do not use external libraries +* Avoid using global variables and avoid `==`. +* Please use `let` over `var`. +* Please refrain from using `console.log()` or any other console methods. +* **Absolutely** don't use `alert`. +* We strongly recommend the use of ECMAScript 6. +* Do not use external libraries. * Most importantly: - * **Be consistent in the use of these guidelines when submitting** - * Happy coding! + * **Be consistent in the use of these guidelines when submitting**. + +### Happy coding! From 0de442f530908098403fc7ce6bbad7eccecede18 Mon Sep 17 00:00:00 2001 From: Rak Laptudirm Date: Fri, 8 Oct 2021 13:46:42 +0530 Subject: [PATCH 3/3] feat: add function import guidelines Added guidelines for importing other function in this repository. --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 64533b184a..15ab4530c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,11 @@ An Algorithm is one or more functions (or classes) that: Algorithms should be packaged in a way that would make it easy for readers to put them into larger programs. +Algorithms can import other algorithms present in the repository, following these guidelines: + +* Imports should use ESM syntax (`import funcs from 'path'`). +* Comments should clearly mention what is being imported, and how it is used. + Algorithms should: * have intuitive class and function names that make their purpose clear to readers.