Skip to content

Commit

Permalink
Refactored structure
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek committed Nov 6, 2022
1 parent f2b44b2 commit 90f5510
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 18 deletions.
3 changes: 1 addition & 2 deletions clim
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
import plotext

from codelimit.Scanner import scan
from codelimit.common.Scanner import scan
from codelimit.version import version, release_date

print('Code Limit')
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions codelimit/Scanner.py → codelimit/common/Scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from halo import Halo

from codelimit.Python import get_headers, get_blocks
from codelimit.Report import Report, Measurement
from codelimit.Scope import build_scopes
from codelimit.languages.python.Python import get_headers, get_blocks
from codelimit.common.Report import Report, Measurement
from codelimit.common.Scope import build_scopes


def is_hidden(root, file):
Expand Down
2 changes: 1 addition & 1 deletion codelimit/Scope.py → codelimit/common/Scope.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from codelimit.SourceRange import Header, Block
from codelimit.common.SourceRange import Header, Block


class Scope:
Expand Down
4 changes: 2 additions & 2 deletions codelimit/Source.py → codelimit/common/Source.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from codelimit.Location import Location
from codelimit.SourceRange import SourceRange
from codelimit.common.Location import Location
from codelimit.common.SourceRange import SourceRange


def index_to_location(code: str, index: int) -> Location:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from codelimit.Location import Location
from codelimit.common.Location import Location


class SourceRange:
Expand Down
Empty file added codelimit/common/__init__.py
Empty file.
Empty file added codelimit/languages/__init__.py
Empty file.
6 changes: 3 additions & 3 deletions codelimit/Python.py → codelimit/languages/python/Python.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from re import finditer

from codelimit.Location import Location
from codelimit.Source import index_to_location
from codelimit.SourceRange import Block, Header
from codelimit.common.Location import Location
from codelimit.common.Source import index_to_location
from codelimit.common.SourceRange import Block, Header


def get_indentation(line: str):
Expand Down
Empty file.
Empty file added tests/common/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions tests/test_Block.py → tests/common/test_Block.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from codelimit.Location import Location
from codelimit.SourceRange import Block
from codelimit.common.Location import Location
from codelimit.common.SourceRange import Block


def test_str():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_Position.py → tests/common/test_Position.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from codelimit.Location import Location
from codelimit.common.Location import Location


def test_str():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_Source.py → tests/common/test_Source.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from codelimit.Location import Location
from codelimit.Source import index_to_location, location_to_index
from codelimit.common.Location import Location
from codelimit.common.Source import index_to_location, location_to_index


def test_index_to_location_single_line():
Expand Down
Empty file added tests/languages/__init__.py
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from codelimit.Python import get_indentation, get_blocks, get_headers
from codelimit.languages.python.Python import get_indentation, get_blocks, get_headers


def test_get_indentation():
Expand Down

0 comments on commit 90f5510

Please sign in to comment.