Skip to content

Commit 374130a

Browse files
bastimeyergravyboat
authored andcommitted
tools: force LF line endings via .gitattributes
https://stackoverflow.com/questions/29435156 - add additional linting steps to Github actions for checking the line endings and file permissions - fix line endings and file permissions
1 parent b31d1ac commit 374130a

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
* text=auto eol=lf
12
src/streamlink/_version.py export-subst

.github/workflows/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ jobs:
3535
- name: Install dependencies
3636
continue-on-error: ${{ matrix.continue || false }}
3737
run: bash ./script/install-dependencies.sh
38-
- name: Lint
38+
- name: Lint (flake8)
3939
continue-on-error: ${{ matrix.continue || false }}
4040
run: flake8 --count
41+
- name: Lint (line terminators)
42+
if: startsWith(matrix.os, 'ubuntu')
43+
run: "! grep 'with CRLF line terminators' <(git ls-files | file -nNf-)"
44+
- name: Lint (file permissions)
45+
if: startsWith(matrix.os, 'ubuntu')
46+
run: "! grep -Ev '^644' <(git ls-files src/ tests/ | xargs stat '--format=%a %n')"
4147
- name: Test
4248
continue-on-error: ${{ matrix.continue || false }}
4349
run: pytest -r a --cov --cov-branch --cov-report=xml

tests/plugins/test_vk.py

100755100644
File mode changed.
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import unittest
2-
3-
from streamlink.plugins.webcast_india_gov import WebcastIndiaGov
4-
5-
6-
class TestPluginWebcastIndiaGov(unittest.TestCase):
7-
def test_can_handle_url(self):
8-
# should match
9-
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/ddpunjabi/"))
10-
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/#Channel1"))
11-
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/#Channel3"))
12-
13-
# shouldn't match
14-
self.assertFalse(WebcastIndiaGov.can_handle_url("http://meity.gov.in/"))
15-
self.assertFalse(WebcastIndiaGov.can_handle_url("http://www.nic.in/"))
16-
self.assertFalse(WebcastIndiaGov.can_handle_url("http://digitalindiaawards.gov.in/"))
1+
import unittest
2+
3+
from streamlink.plugins.webcast_india_gov import WebcastIndiaGov
4+
5+
6+
class TestPluginWebcastIndiaGov(unittest.TestCase):
7+
def test_can_handle_url(self):
8+
# should match
9+
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/ddpunjabi/"))
10+
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/#Channel1"))
11+
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/#Channel3"))
12+
13+
# shouldn't match
14+
self.assertFalse(WebcastIndiaGov.can_handle_url("http://meity.gov.in/"))
15+
self.assertFalse(WebcastIndiaGov.can_handle_url("http://www.nic.in/"))
16+
self.assertFalse(WebcastIndiaGov.can_handle_url("http://digitalindiaawards.gov.in/"))

0 commit comments

Comments
 (0)