mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-07 19:08:30 +03:00
Fix unused imports and include rule.
This commit is contained in:
@@ -98,6 +98,8 @@ markers = [
|
||||
line-length = 120
|
||||
# Remove this for a more detailed lint report
|
||||
output-format = "concise"
|
||||
# TODO: temp ignore rule for timestamping_enricher to allow for open PR
|
||||
exclude = ["src/auto_archiver/modules/timestamping_enricher/*"]
|
||||
|
||||
|
||||
[tool.ruff.lint]
|
||||
@@ -105,16 +107,13 @@ output-format = "concise"
|
||||
# See documentation for more details: https://docs.astral.sh/ruff/rules/
|
||||
#extend-select = ["B"]
|
||||
|
||||
# Ignore unused imports as some are currently required for lazy loading
|
||||
# This can be removed for a `ruff check` run which is manually reviewed
|
||||
#ignore = ["F401"]
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
# Ignore import violations in __init__.py files
|
||||
"__init__.py" = ["F401", "F403"]
|
||||
# Ignore 'useless expression' in manifest files.
|
||||
"__manifest__.py" = ["B018"]
|
||||
|
||||
|
||||
[tool.ruff.format]
|
||||
docstring-code-format = false
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ Here's how that would look: \n\nsteps:\n extractors:\n - [your_extractor_name_
|
||||
self.setup(args)
|
||||
return self.feed()
|
||||
except Exception as e:
|
||||
logger.error(e, exc_info=True)
|
||||
logger.error(e)
|
||||
exit(1)
|
||||
|
||||
def cleanup(self) -> None:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import pytest
|
||||
|
||||
from auto_archiver.core import Metadata
|
||||
from auto_archiver.modules.api_db import AAApiDb
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ def mock_media(mocker):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def gsheets_db(mock_gworksheet, setup_module, mocker):
|
||||
def gsheets_db(mock_gworksheet, setup_module, mocker) -> GsheetsFeederDB:
|
||||
mocker.patch("gspread.service_account")
|
||||
config: dict = {
|
||||
"sheet": "testsheet",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
import datetime
|
||||
import hashlib
|
||||
import pytest
|
||||
|
||||
from pytwitter.models.media import MediaVariant
|
||||
@@ -10,7 +9,7 @@ from auto_archiver.modules.twitter_api_extractor import TwitterApiExtractor
|
||||
|
||||
@pytest.mark.incremental
|
||||
class TestTwitterApiExtractor(TestExtractorBase):
|
||||
extractor_module = "twitter_api_extractor"
|
||||
extractor_module: TwitterApiExtractor = "twitter_api_extractor"
|
||||
|
||||
config = {
|
||||
"bearer_tokens": [],
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
from typing import Type
|
||||
import pytest
|
||||
from oauth2client import service_account
|
||||
|
||||
from auto_archiver.core import Media
|
||||
from auto_archiver.modules.gdrive_storage import GDriveStorage
|
||||
from auto_archiver.core.metadata import Metadata
|
||||
from tests.storages.test_storage_base import TestStorageBase
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ def autoarchiver(tmp_path, monkeypatch, request):
|
||||
def test_run_auto_archiver_no_args(caplog, autoarchiver):
|
||||
with pytest.raises(SystemExit):
|
||||
autoarchiver()
|
||||
|
||||
assert "provide at least one URL via the command line, or set up an alternative feeder" in caplog.text
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
import pytest
|
||||
from auto_archiver.core.module import ModuleFactory, LazyBaseModule
|
||||
from auto_archiver.core.base_module import BaseModule
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
import sys
|
||||
from argparse import ArgumentParser, ArgumentTypeError
|
||||
from auto_archiver.core.orchestrator import ArchivingOrchestrator
|
||||
from auto_archiver.version import __version__
|
||||
|
||||
Reference in New Issue
Block a user