Browse Source

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
pull/3445/head
bastimeyer 10 months ago
committed by Forrest
parent
commit
374130a4de
  1. 1
      .gitattributes
  2. 8
      .github/workflows/main.yml
  3. 0
      tests/plugins/test_vk.py
  4. 32
      tests/plugins/test_webcast_india_gov.py

1
.gitattributes

@ -1 +1,2 @@
* text=auto eol=lf
src/streamlink/_version.py export-subst

8
.github/workflows/main.yml

@ -35,9 +35,15 @@ jobs:
- name: Install dependencies
continue-on-error: ${{ matrix.continue || false }}
run: bash ./script/install-dependencies.sh
- name: Lint
- name: Lint (flake8)
continue-on-error: ${{ matrix.continue || false }}
run: flake8 --count
- name: Lint (line terminators)
if: startsWith(matrix.os, 'ubuntu')
run: "! grep 'with CRLF line terminators' <(git ls-files | file -nNf-)"
- name: Lint (file permissions)
if: startsWith(matrix.os, 'ubuntu')
run: "! grep -Ev '^644' <(git ls-files src/ tests/ | xargs stat '--format=%a %n')"
- name: Test
continue-on-error: ${{ matrix.continue || false }}
run: pytest -r a --cov --cov-branch --cov-report=xml

0
tests/plugins/test_vk.py

32
tests/plugins/test_webcast_india_gov.py

@ -1,16 +1,16 @@
import unittest
from streamlink.plugins.webcast_india_gov import WebcastIndiaGov
class TestPluginWebcastIndiaGov(unittest.TestCase):
def test_can_handle_url(self):
# should match
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/ddpunjabi/"))
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/#Channel1"))
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/#Channel3"))
# shouldn't match
self.assertFalse(WebcastIndiaGov.can_handle_url("http://meity.gov.in/"))
self.assertFalse(WebcastIndiaGov.can_handle_url("http://www.nic.in/"))
self.assertFalse(WebcastIndiaGov.can_handle_url("http://digitalindiaawards.gov.in/"))
import unittest
from streamlink.plugins.webcast_india_gov import WebcastIndiaGov
class TestPluginWebcastIndiaGov(unittest.TestCase):
def test_can_handle_url(self):
# should match
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/ddpunjabi/"))
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/#Channel1"))
self.assertTrue(WebcastIndiaGov.can_handle_url("http://webcast.gov.in/#Channel3"))
# shouldn't match
self.assertFalse(WebcastIndiaGov.can_handle_url("http://meity.gov.in/"))
self.assertFalse(WebcastIndiaGov.can_handle_url("http://www.nic.in/"))
self.assertFalse(WebcastIndiaGov.can_handle_url("http://digitalindiaawards.gov.in/"))

Loading…
Cancel
Save