Skip to content

Commit

Permalink
fixed linting issues and added settings for vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
redrussianarmy committed Feb 21, 2023
1 parent cde908c commit b2efaf9
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 6 deletions.
35 changes: 34 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,40 @@
"request": "launch",
"program": "${workspaceFolder}/file_merger.py",
"args": [
"armel"
"-i",
"${workspaceFolder}\\dataset\\small_dataset",
"-f",
"${workspaceFolder}\\dataset\\output.txt"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python: Generate Fake Dataset",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/setup.py",
"args": [
"generate_fake_dataset",
"--num-files",
"5",
"--min-words-per-file",
"100",
"--max-words-per-file",
"500",
"--output-dir",
"dataset/small_dataset"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python: Coverage Report",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/setup.py",
"args": [
"coverage"
],
"console": "integratedTerminal",
"justMyCode": true
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
"python.linting.enabled": true,
"python.formatting.autopep8Args": [
"--max-line-length=100"
]
}
Empty file added __init__.py
Empty file.
2 changes: 1 addition & 1 deletion merge_files/mergers/async_.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import shutil

from .base import FileMerger
from merge_files.mergers.base import FileMerger


class AsyncFileMerger(FileMerger):
Expand Down
2 changes: 1 addition & 1 deletion merge_files/mergers/basic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .base import FileMerger
from merge_files.mergers.base import FileMerger


class BasicFileMerger(FileMerger):
Expand Down
2 changes: 1 addition & 1 deletion merge_files/mergers/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import shutil
from typing import List

from .base import FileMerger
from merge_files.mergers.base import FileMerger


class ParallelFileMerger(FileMerger):
Expand Down
2 changes: 1 addition & 1 deletion merge_files/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def check_valid_path(path: str) -> str:
ref.extractall(extract_path)
return extract_path
except (zipfile.BadZipfile, tarfile.ReadError) as e:
raise ValueError(f"File could not be opened successfully: {e}")
raise ValueError(f"File could not be opened successfully:") from e

# if the path is not a folder or a supported compressed file type, raise an exception
raise ValueError(f"Please enter a valid path: {path}")
Expand Down
1 change: 1 addition & 0 deletions scripts/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def generate_fake_dataset(num_files: int, min_words_per_file: int,
output_file = os.path.join(output_dir, f'file_{i}.dat')
with open(output_file, 'w') as f:
f.write('\n'.join(words))
print("Fake dataset has been generated.")


if __name__ == "__main__":
Expand Down

0 comments on commit b2efaf9

Please sign in to comment.