Skip to content

Commit

Permalink
Generate infection.json (without .dist postfix) by default (#1554)
Browse files Browse the repository at this point in the history
* Generate `infection.json` (without `.dist` postfix), because it's a json file and **any** IDE automatically understands it.

Currently, generated `.dist` file is not recognized as JSON file by PHPStorm, which makes it work like usual text file, where JSON autocompletion won't work

* Rename `infection.json.dist` to `infection.json`
  • Loading branch information
maks-rafalko committed Aug 11, 2021
1 parent 2a1a91a commit aabbd60
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -12,7 +12,6 @@
/build/
/devTools/Docker*.json
/infection-cache
/infection.json
/infection.log
/phpunit.xml
/tests/benchmark/*/coverage/
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Command/ConfigureCommand.php
Expand Up @@ -216,7 +216,7 @@ private function saveConfig(
];

file_put_contents(
SchemaConfigurationLoader::DEFAULT_DIST_CONFIG_FILE,
SchemaConfigurationLoader::DEFAULT_CONFIG_FILE,
json_encode($configObject, JSON_PRETTY_PRINT)
);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/Configure/run_tests.bash
Expand Up @@ -7,7 +7,7 @@ if test ! -f "$(which expect)"; then
fi

cd $(dirname $0)
rm -f infection.json.dist
rm -f infection.json

set -e

Expand All @@ -25,5 +25,5 @@ unset GITHUB_ACTIONS

./do_configure.expect

test -f infection.json.dist
diff -u infection.json.test infection.json.dist
test -f infection.json
diff -u infection.json.test infection.json
4 changes: 2 additions & 2 deletions tests/e2e/Initial_Configuration/run_tests.bash
Expand Up @@ -7,7 +7,7 @@ if test ! -f "$(which expect)"; then
fi

cd $(dirname $0)
rm -v -f infection.json.dist infection.log
rm -v -f infection.json infection.log

set -e

Expand All @@ -27,4 +27,4 @@ unset GITHUB_ACTIONS

trap 'echo Final check failed: $(tail -n+$LINENO $0 | head -n1)' ERR

test -f infection.json.dist
test -f infection.json

0 comments on commit aabbd60

Please sign in to comment.