From 2c49df9bd5b4607222a55352748144be431e5fe8 Mon Sep 17 00:00:00 2001 From: autoprettier Date: Sun, 30 Oct 2022 15:02:08 +0000 Subject: [PATCH 1/3] Formatting filenames d6c39aee --- Maths/LowestCommonMultiple.ts => maths/lowestcommonmultiple.ts | 0 .../test/lowestcommonmultiple.test.ts | 0 Search/LinearSearch.ts => search/linearsearch.ts | 0 .../test/LinearSearch.test.ts => search/test/linearsearch.test.ts | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename Maths/LowestCommonMultiple.ts => maths/lowestcommonmultiple.ts (100%) rename Maths/test/LowestCommonMultiple.test.ts => maths/test/lowestcommonmultiple.test.ts (100%) rename Search/LinearSearch.ts => search/linearsearch.ts (100%) rename Search/test/LinearSearch.test.ts => search/test/linearsearch.test.ts (100%) diff --git a/Maths/LowestCommonMultiple.ts b/maths/lowestcommonmultiple.ts similarity index 100% rename from Maths/LowestCommonMultiple.ts rename to maths/lowestcommonmultiple.ts diff --git a/Maths/test/LowestCommonMultiple.test.ts b/maths/test/lowestcommonmultiple.test.ts similarity index 100% rename from Maths/test/LowestCommonMultiple.test.ts rename to maths/test/lowestcommonmultiple.test.ts diff --git a/Search/LinearSearch.ts b/search/linearsearch.ts similarity index 100% rename from Search/LinearSearch.ts rename to search/linearsearch.ts diff --git a/Search/test/LinearSearch.test.ts b/search/test/linearsearch.test.ts similarity index 100% rename from Search/test/LinearSearch.test.ts rename to search/test/linearsearch.test.ts From 29ba9408c18c6bac8ffc7ce936702199c8685045 Mon Sep 17 00:00:00 2001 From: David Leal Date: Sun, 30 Oct 2022 09:07:54 -0600 Subject: [PATCH 2/3] docs: update filename guidelines The directory workflow won't work with the current filename guidelines, and thus will generate a bad-formatted file. --- CONTRIBUTING.md | 4 ++-- DIRECTORY.md | 2 ++ maths/{lowestcommonmultiple.ts => lowest_common_multiple.ts} | 2 +- ...tcommonmultiple.test.ts => lowest_common_multiple.test.ts} | 2 +- search/{linearsearch.ts => linear_search.ts} | 0 search/test/{linearsearch.test.ts => linear_search.test.ts} | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) rename maths/{lowestcommonmultiple.ts => lowest_common_multiple.ts} (96%) rename maths/test/{lowestcommonmultiple.test.ts => lowest_common_multiple.test.ts} (94%) rename search/{linearsearch.ts => linear_search.ts} (100%) rename search/test/{linearsearch.test.ts => linear_search.test.ts} (87%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 478cc824..e81cefe3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,9 +56,9 @@ should add unique value. #### File Naming Convention -- Filenames should use the UpperCamelCase (PascalCase) style. +- Filenames should use the snake_case style. This is needed for our workflows to work correctly. - There should be no spaces in filenames. -- **Example:** `UserProfile.ts` is allowed. Do not use `userprofile.ts`, `Userprofile.ts`, `user-Profile.ts`, `userProfile.ts`; these naming conventions are discouraged. +- **Example:** `user_profile.ts` is allowed. Do not use `userprofile.ts`, `Userprofile.ts`, `user-Profile.ts`, `userProfile.ts`, `UserProfile.ts`; these naming conventions are discouraged. #### Commit Messages Formatting diff --git a/DIRECTORY.md b/DIRECTORY.md index 6e3cb812..a306529b 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -24,12 +24,14 @@ * [Is Even](https://github.com/TheAlgorithms/TypeScript/blob/master/maths/is_even.ts) * [Is Leap Year](https://github.com/TheAlgorithms/TypeScript/blob/master/maths/is_leap_year.ts) * [Is Odd](https://github.com/TheAlgorithms/TypeScript/blob/master/maths/is_odd.ts) + * [Lowest Common Multiple](https://github.com/TheAlgorithms/TypeScript/blob/master/maths/lowest_common_multiple.ts) * [Perfect Square](https://github.com/TheAlgorithms/TypeScript/blob/master/maths/perfect_square.ts) * [Radians To Degrees](https://github.com/TheAlgorithms/TypeScript/blob/master/maths/radians_to_degrees.ts) * [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/TypeScript/blob/master/maths/sieve_of_eratosthenes.ts) ## Search * [Binary Search](https://github.com/TheAlgorithms/TypeScript/blob/master/search/binary_search.ts) + * [Linearsearch](https://github.com/TheAlgorithms/TypeScript/blob/master/search/linearsearch.ts) ## Sorts * [Bubble Sort](https://github.com/TheAlgorithms/TypeScript/blob/master/sorts/bubble_sort.ts) diff --git a/maths/lowestcommonmultiple.ts b/maths/lowest_common_multiple.ts similarity index 96% rename from maths/lowestcommonmultiple.ts rename to maths/lowest_common_multiple.ts index fe311b64..c690ae05 100644 --- a/maths/lowestcommonmultiple.ts +++ b/maths/lowest_common_multiple.ts @@ -9,7 +9,7 @@ * @example LowestCommonMultiple(5, 8, 3) = 120 */ -import { greatestCommonFactor } from "./GreatestCommonFactor"; +import { greatestCommonFactor } from "./greatest_common_factor"; //A naive solution which requires no additional mathematical algorithm diff --git a/maths/test/lowestcommonmultiple.test.ts b/maths/test/lowest_common_multiple.test.ts similarity index 94% rename from maths/test/lowestcommonmultiple.test.ts rename to maths/test/lowest_common_multiple.test.ts index 00dac6d3..55ea9a24 100644 --- a/maths/test/lowestcommonmultiple.test.ts +++ b/maths/test/lowest_common_multiple.test.ts @@ -1,4 +1,4 @@ -import { binaryLCM, lowestCommonMultiple, naiveLCM } from "../LowestCommonMultiple"; +import { binaryLCM, lowestCommonMultiple, naiveLCM } from "../lowest_common_multiple"; describe("naiveLCM", () => { test.each([[[3, 4], 12], [[8, 6], 24], [[5, 8, 3], 120], [[0.8, 0.4], 0.8]])( diff --git a/search/linearsearch.ts b/search/linear_search.ts similarity index 100% rename from search/linearsearch.ts rename to search/linear_search.ts diff --git a/search/test/linearsearch.test.ts b/search/test/linear_search.test.ts similarity index 87% rename from search/test/linearsearch.test.ts rename to search/test/linear_search.test.ts index 71021022..b0ab6605 100644 --- a/search/test/linearsearch.test.ts +++ b/search/test/linear_search.test.ts @@ -1,4 +1,4 @@ -import { linearSearch } from "../LinearSearch"; +import { linearSearch } from "../linear_search"; describe("Linear search", () => { test.each([ From 7c34ea6283a0e8ff345b362aa3ea3534b0b09e36 Mon Sep 17 00:00:00 2001 From: autoprettier Date: Sun, 30 Oct 2022 15:20:22 +0000 Subject: [PATCH 3/3] Update DIRECTORY.md --- DIRECTORY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index a306529b..53d56eaf 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -31,7 +31,7 @@ ## Search * [Binary Search](https://github.com/TheAlgorithms/TypeScript/blob/master/search/binary_search.ts) - * [Linearsearch](https://github.com/TheAlgorithms/TypeScript/blob/master/search/linearsearch.ts) + * [Linear Search](https://github.com/TheAlgorithms/TypeScript/blob/master/search/linear_search.ts) ## Sorts * [Bubble Sort](https://github.com/TheAlgorithms/TypeScript/blob/master/sorts/bubble_sort.ts)