Skip to content

Commit

Permalink
Merge pull request #5 from furkanonder/develop
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
furkanonder authored Aug 10, 2022
2 parents 480ba8d + f4559bb commit bc8e3c1
Show file tree
Hide file tree
Showing 11 changed files with 432 additions and 188 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
pyv: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3

- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@v2.1.4
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
python-version: ${{ matrix.pyv }}

- name: Test with unittest
- name: Test
run: |
python -m unittest discover -v
53 changes: 52 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
*.pyc
*.db
*.scssc
Expand Down Expand Up @@ -134,4 +185,4 @@ pyvenv.cfg
pip-selfcheck.json


# End of https://www.gitignore.io/api/python
# End of https://www.gitignore.io/api/python
56 changes: 37 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 21.7b0
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
- id: black
args: [--line-length=79]

- repo: https://github.com/PyCQA/isort
rev: 5.9.2
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/hakancelikdev/unimport
rev: 0.8.4
- repo: https://github.com/hakancelikdev/unimport
rev: 0.10.0
hooks:
- id: unimport
args: [--remove, --include-star-import]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
- repo: https://github.com/PyCQA/docformatter
rev: v1.4
hooks:
- id: docformatter
args: [--in-place]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
args: [--no-strict-optional, --ignore-missing-imports, --show-error-codes]
additional_dependencies: [types-toml==0.1.3]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
files: "\\.(py|.txt|.yaml|.json|.in|.md|.toml|.cfg|.html|.yml)$"

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py36-plus]
62 changes: 39 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,93 @@
</div>

## Installation
_bor_ can be installed by running `pip install bor`. It requires Python 3.6.0+ to run.

_bor_ can be installed by running `pip install bor`. It requires Python 3.8.0+ to run.

## Usage
_bor_ currently supports 'class' and 'def' keywords. Other Python keywords will be added in the future releases.

_bor_ currently supports `class` and `def` keywords. Other Python keywords will be added
in the future releases.

```sh
bor {keyword} {pattern}
```

By default, _bor_ runs in your current directory. You can run _bor_ with the specific source file or directory:
By default, _bor_ runs in your current directory. You can run _bor_ with the specific
source file or directory:

```sh
bor {keyword} {pattern} {source_file_or_directory}
```

## Configuration

By default, if _bor_ encounters an error(syntax, indentation error etc.) while analyzing files, it will stop working.
If you want to the ignore errors, you can use `--ignore-error` or `-i` argument. For example;
By default, if _bor_ encounters an error(syntax, indentation error etc.) while analyzing
files, it will stop working. If you want to the ignore errors, you can use
`--ignore-error` or `-i` argument. For example;

```sh
bor class Cat --ignore-error
```

## Example Usages

Cat is equivalent in the regular expression as '^Cat$'
`Cat` is equivalent in the regular expression as `^Cat$`

```sh
bor class Cat
```

Output:

```sh
Cat at /home/furkan/bor/examples/test.py : [18]
Cat at examples/test.py:18
```

***
---

`.Cat` is equivalent in the regular expression as `Cat$`

.Cat is equivalent in the regular expression as 'Cat$'
```sh
bor class .Cat
```

Output:

```sh
Cat at /home/furkan/bor/examples/test.py : [18]
BlueCat at /home/furkan/bor/examples/test.py : [26]
Cat at examples/test.py:18
BlueCat at examples/test.py:26
```

***
---

`get.` is equivalent in the regular expression as `^get`

get. is equivalent in the regular expression as '^get'
```sh
bor def get. examples/test.py
```

Output:
```sh
get_value at /home/furkan/bor/examples/test.py : [5]
get_blue_value at /home/furkan/bor/examples/test.py : [11]
get_purple_value at /home/furkan/bor/examples/test.py : [14]
get_meow at /home/furkan/bor/examples/test.py : [22]

```sh
get_value at examples/test.py:5
get_blue_value at examples/test.py:11
get_purple_value at examples/test.py:14
get_meow at examples/test.py:22
```

***
---

`.cat.` is equivalent in the regular expression as `cat+`

.cat. is equivalent in the regular expression as 'cat+'
```sh
bor def .cat.
```

Output:

```sh
catch_me_if_you_can at /home/furkan/bor/examples/test.py : [8]
am_i_blue_cat at /home/furkan/bor/examples/test.py : [30]
where_is_the_cat at /home/furkan/bor/examples/test.py : [38]
catch_me_if_you_can at examples/test.py:8
am_i_blue_cat at examples/test.py:30
where_is_the_cat at examples/test.py:38
```
114 changes: 0 additions & 114 deletions bor.py

This file was deleted.

Loading

0 comments on commit bc8e3c1

Please sign in to comment.