Skip to content

Commit

Permalink
fix: Rename tool on patterns.json :breaking:
Browse files Browse the repository at this point in the history
  • Loading branch information
josemiguelmelo committed Jul 15, 2020
1 parent fcc8592 commit 3c6c3b8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ The docker is ran with the following command:
docker run -it -v $srcDir:/src codacy-prospector:latest
```

## Generate Docs

1. Update the version in `docs/patterns.json`
2. Run the DocGenerator:

```bash
sbt "doc-generator/run"
```

## Test

We use the [codacy-plugins-test](https://github.com/codacy/codacy-plugins-test) to test our external tools integration.
Expand Down
2 changes: 1 addition & 1 deletion docs/patterns.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Prospector",
"name": "prospector",
"version": "1.2.0",
"patterns": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/codacy_prospector.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def allFiles(): return walkDirectory(srcDir)
try:
configuration = readJsonFile(configFile)
files = configuration.get('files') or allFiles()
tools = [t for t in configuration['tools'] if t['name'] == 'Prospector']
tools = [t for t in configuration['tools'] if t['name'] == 'prospector']
if tools and 'patterns' in tools[0]:
prospector = tools[0]
tools = set([p['patternId'] for p in prospector.get('patterns') or []])
Expand Down
4 changes: 2 additions & 2 deletions src/codacy_prospector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def dup_function():
return 2
'''
sources = [('E0102.py', source)]
config = '{"tools":[{"name":"Prospector"}],"files":["E0102.py"]}'
config = '{"tools":[{"name":"prospector"}],"files":["E0102.py"]}'
return config, sources

class ResultTest(unittest.TestCase):
Expand All @@ -63,7 +63,7 @@ def test_readConfiguration(self):
with tempfile.TemporaryDirectory() as directory:
codacyrcPath = os.path.join(directory, ".codacyrc")
with open(codacyrcPath, "w") as codacyrc:
print('{"tools":[{"name":"Prospector", "patterns":[{"patternId":"pyroma"}]}],"files":["C0111.py"]}', file=codacyrc)
print('{"tools":[{"name":"prospector", "patterns":[{"patternId":"pyroma"}]}],"files":["C0111.py"]}', file=codacyrc)

expectedOptions = {'--without-tool=pylint',
'--without-tool=pydocstyle',
Expand Down

0 comments on commit 3c6c3b8

Please sign in to comment.