Navigation Menu

Skip to content

Commit

Permalink
Adjust header levels and update test
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Jun 4, 2015
1 parent 985b5c3 commit 44203e9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 39 deletions.
2 changes: 0 additions & 2 deletions .sublimelinterrc
Expand Up @@ -2,12 +2,10 @@
"@python": 3,
"linters": {
"flake8": {
"@disable": false,
"ignore": "",
"max-line-length": 120
},
"pep257": {
"@disable": false,
"ignore": "D202"
}
}
Expand Down
12 changes: 6 additions & 6 deletions docs/contributing.md
Expand Up @@ -3,7 +3,7 @@ Steps for contributing and getting support.

---

# Overview
## Overview

| Sublime Versions | Description |
|------------------|-------------|
Expand All @@ -17,7 +17,7 @@ Contribution from the community is encouraged and can be done in a variety of wa
- Code patches via pull requests.
- Documentation improvements via pull requests.

# Bug Reports
## Bug Reports

1. Please **read the documentation** and **search the issue tracker** to try to find the answer to your question **before** posting an issue.

Expand All @@ -33,17 +33,17 @@ Contribution from the community is encouraged and can be done in a variety of wa

3. Be prepared to answer questions and provide additional information if required. Issues in which the creator refuses to respond to follow up questions will be marked as stale and closed.

# Reviewing Code
## Reviewing Code
Take part in reviewing pull requests and/or reviewing direct commits. Make suggestions to improve the code and discuss solutions to overcome weakness in the algorithm.

# Pull Requests
## Pull Requests
Pull requests are welcome, and if you plan on contributing directly to the code, there are a couple of things to be mindful of.

Continuous integration tests on are run on all pull requests and commits via Travis CI. When making a pull request, the tests will automatically be run, and the request must pass to be accepted. You can (and should) run these tests before pull requesting. If it is not possible to run these tests locally, they will be run when the pull request is made, but it is strongly suggested that requesters make an effort to verify before requesting to allow for a quick, smooth merge.

Feel free to use a virtual environment if you are concerned about installing any of the Python packages. In the future, I may use tox, but as I currently only test on Python 3.3, I wanted to keep things simple.

## Running Validation Tests
### Running Validation Tests

!!! tip "Tip"
If you are running Sublime on a OSX or Linux/Unix system, you run all tests by by running the shell script (assuming you have installed your environment fulfills all requirements below):
Expand Down Expand Up @@ -83,7 +83,7 @@ There are a couple of dependencies that must be present before running the tests
flake8 .
```

# Documentation Improvements
## Documentation Improvements
A ton of time has been not only creating and supporting this plugin, but also spent making this documentation. If you feel it is still lacking, show your appreciation for the plugin by helping to improve the documentation. Help with documentation is always appreciated and can be done via pull requests. There shouldn't be any need to run validation tests if only updating documentation.

I currently use a combination of using [mkdocs][mkdocs.org] with my own custom Python Markdown [extensions](https://github.com/facelessuser/pymdown-extensions) to render the docs. You can preview the docs if you install these two packages. The command for previewing the docs is `mkdocs serve`.
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Expand Up @@ -3,10 +3,10 @@ A regex sequencer for Sublime Text.

---

# Overview
## Overview
Reg Replace is a plugin for Sublime Text that allows the creating of commands consisting of sequences of find and replace instructions.

# Features
## Features

- Create find and replace rules that can then be used to create Sublime Commands to call at any time.
- Chain multiple regex find and replace rules together.
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Expand Up @@ -3,7 +3,7 @@ Installing RegReplace.

---

# Package Control
## Package Control
The recommended way to install RegReplace is via [Package Control](https://packagecontrol.io/). Package Control will install the correct branch on your system and keep it up to date.

1. Ensure Package Control is installed. Instructions are found [here](https://packagecontrol.io/installation).
Expand All @@ -16,7 +16,7 @@ The recommended way to install RegReplace is via [Package Control](https://packa

5. Enjoy!

# Git Cloning
## Git Cloning

!!! warning "Warning"
This is not the recommended way to install RegReplace for the casual user as it requires the user to know which branch to install, know how to use git, and **will not** get automatically updated.
Expand Down
6 changes: 3 additions & 3 deletions docs/usage.md
Expand Up @@ -3,7 +3,7 @@ Configuring and using RegReplace.

---

# Create Find and Replace Sequences
## Create Find and Replace Sequences
To use, replacements must be defined in the reg_replace.sublime-settings file.

There are two kinds of definitions. The first uses regex to find regions, and then you can use scopes to qualify the regions before applying the replace.
Expand Down Expand Up @@ -103,7 +103,7 @@ You can also bind a replacement command to a shortcut.
}
```
# View Without Replacing
## View Without Replacing
If you would simply like to view what the sequence would find without replacing, you can construct a command to highlight targets without replacing them (each pass could affect the end result, but this just shows all passes without predicting replaces).
Just add the "find_only" argument and set it to true.
Expand All @@ -122,7 +122,7 @@ If for any reason the highlights do not get cleared, you can simply run the "Reg
Highlight color and style can be changed in the settings file.
# Override Actions
## Override Actions
If instead of replacing you would like to do something else, you can override the action. Actions are defined in commands by setting the `action` parameter. Some actions may require additional parameters be set in the `options` parameter. See examples below.
```javascript
Expand Down
44 changes: 22 additions & 22 deletions mkdocs.yml
Expand Up @@ -3,28 +3,28 @@ repo_url: https://github.com/facelessuser/RegReplace
site_description: A Sublime Text plugin for creating regex sequences.
copyright: Copyright &copy; 2011 - 2015 <a href="https://github.com/facelessuser">Isaac Muse</a>
pages:
- About RegReplace: index.md
- Installation: installation.md
- User Guide: usage.md
- Contributing & Support: contributing.md
- License: license.md
- About RegReplace: index.md
- Installation: installation.md
- User Guide: usage.md
- Contributing &amp; Support: contributing.md
- License: license.md
theme: readthedocs
theme_dir: doc_theme
markdown_extensions:
- markdown.extensions.extra
- markdown.extensions.admonition
- markdown.extensions.smarty
- markdown.extensions.nl2br
- markdown.extensions.codehilite:
guess_lang: false
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.betterem
- pymdownx.tilde
- pymdownx.caret
- pymdownx.smartsymbols
- pymdownx.githubemoji
- pymdownx.tasklist
- pymdownx.superfences
- pymdownx.progressbar
- pymdownx.headeranchor
- markdown.extensions.extra
- markdown.extensions.admonition
- markdown.extensions.smarty
- markdown.extensions.nl2br
- markdown.extensions.codehilite:
guess_lang: false
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.betterem
- pymdownx.tilde
- pymdownx.caret
- pymdownx.smartsymbols
- pymdownx.githubemoji
- pymdownx.tasklist
- pymdownx.superfences
- pymdownx.progressbar
- pymdownx.headeranchor
7 changes: 5 additions & 2 deletions tests/test_json.py
Expand Up @@ -9,12 +9,15 @@ class TestSettings(unittest.TestCase):

"""Test JSON settings."""

def _get_json_files(self, pattern):
def _get_json_files(self, pattern, folder='.'):
"""Get json files."""

for root, dirnames, filenames in os.walk('.'):
for root, dirnames, filenames in os.walk(folder):
for filename in fnmatch.filter(filenames, pattern):
yield os.path.join(root, filename)
for dirname in [d for d in dirnames if d not in ('.svn', '.git', '.tox')]:
for f in self._get_json_files(pattern, os.path.join(root, dirname)):
yield f

def test_json_settings(self):
"""Test each JSON file."""
Expand Down

0 comments on commit 44203e9

Please sign in to comment.