From 8a7f76e64b97f48d89f5e631ef63d32b81824534 Mon Sep 17 00:00:00 2001 From: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Date: Fri, 16 Aug 2024 23:54:23 +0000 Subject: [PATCH 1/2] ci: add integration workflow to check if files end in a newline character --- .github/workflows/integration.yaml | 11 +++++++++++ .linelint.yml | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/integration.yaml create mode 100644 .linelint.yml diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml new file mode 100644 index 000000000..cd481d9a9 --- /dev/null +++ b/.github/workflows/integration.yaml @@ -0,0 +1,11 @@ +name: 🔄 Integration + +on: + pull_request: + +jobs: + linelint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: fernandrone/linelint@0.0.6 diff --git a/.linelint.yml b/.linelint.yml new file mode 100644 index 000000000..75a08500e --- /dev/null +++ b/.linelint.yml @@ -0,0 +1,18 @@ +# 'true' will fix files +autofix: false + +# list of paths to ignore, uses gitignore syntaxes (executes before any rule) +ignore: + - "*.md" + +rules: + # checks if file ends in a newline character + end-of-file: + # set to true to enable this rule + enable: true + + # set to true to disable autofix (if enabled globally) + disable-autofix: false + + # if true also checks if file ends in a single newline character + single-new-line: false From 3adb66b4367655de27a37c16725a576b52033627 Mon Sep 17 00:00:00 2001 From: Dale Seo Date: Sat, 17 Aug 2024 07:18:19 -0400 Subject: [PATCH 2/2] fix: add missing newlines at end of files --- contains-duplicate/kimyoung.js | 2 +- number-of-1-bits/sun912.py | 2 +- palindromic-substrings/kimyoung.js | 2 +- palindromic-substrings/wogha95.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contains-duplicate/kimyoung.js b/contains-duplicate/kimyoung.js index d8688c3a5..c2547e886 100644 --- a/contains-duplicate/kimyoung.js +++ b/contains-duplicate/kimyoung.js @@ -10,4 +10,4 @@ console.log(containsDuplicate([1, 2, 3, 1])); // true console.log(containsDuplicate([1, 2, 3, 4])); // false // space - O(n) - creating a set to store elements -// time - O(n) - traverse through the array \ No newline at end of file +// time - O(n) - traverse through the array diff --git a/number-of-1-bits/sun912.py b/number-of-1-bits/sun912.py index 0df9a5d29..d2f427702 100644 --- a/number-of-1-bits/sun912.py +++ b/number-of-1-bits/sun912.py @@ -10,4 +10,4 @@ def hammingWeight(self, n: int) -> int: result += n % 2 n = n//2 - return result \ No newline at end of file + return result diff --git a/palindromic-substrings/kimyoung.js b/palindromic-substrings/kimyoung.js index 5c1b43321..5e465e933 100644 --- a/palindromic-substrings/kimyoung.js +++ b/palindromic-substrings/kimyoung.js @@ -26,4 +26,4 @@ console.log(countSubstrings("a")); // 1 console.log(countSubstrings("")); // 0 // space - O(1) - constant variable `result` -// time - O(n^2) - iterating through the string and expanding both ways \ No newline at end of file +// time - O(n^2) - iterating through the string and expanding both ways diff --git a/palindromic-substrings/wogha95.js b/palindromic-substrings/wogha95.js index eae4f8376..ba88cde5d 100644 --- a/palindromic-substrings/wogha95.js +++ b/palindromic-substrings/wogha95.js @@ -29,4 +29,4 @@ var countSubstrings = function(s) { return true; } -}; \ No newline at end of file +};