Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier #97

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "vscode-phpunit",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm",
"features": {
"ghcr.io/devcontainers/features/php": {
"version": "latest",
"installComposer": true
}
},
"postStartCommand": "npm install && npm run build"
"name": "vscode-phpunit",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm",
"features": {
"ghcr.io/devcontainers/features/php": {
"version": "latest",
"installComposer": true
}
},
"postStartCommand": "npm install && npm run build"
}
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ root = true
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 2
indent_size = 2
14 changes: 10 additions & 4 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,35 @@
name: Bug report
about: Create a report to help us improve
---

<!-- Thanks for contributing an issue, please fill out the fields below -->

## Repro

1. …
2. …
3. …

## Outcome


## Expected outcome


## Logs / output / settings

<!-- For example from:
- OUTPUT -> phpunit pane (contains the final command that's being run)
- TERMINAL -> Task pane
- Your settings.json
- Help -> Toggle developer tools
-->


| **Environment** | **Values** |
|---|---|
| *Extension version* | … |
| *Operating system* | … |
| **Environment** | **Values** |
| ------------------- | ---------- |
| _Extension version_ | … |
| _Operating system_ | … |
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Minor version should be even for release and odd for pre-release
- "[0-9]+.[0-9]+.[0-9]+" # Minor version should be even for release and odd for pre-release

jobs:
create_release:
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
76 changes: 35 additions & 41 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,38 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceRoot}",
"${workspaceRoot}/src/test/php-project"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"!**/node_modules/**"
],
"sourceMaps": true,
"preLaunchTask": "npm",
"smartStep": true
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/suite/index",
"${workspaceRoot}/src/test/php-project"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"!**/node_modules/**"
],
"sourceMaps": true,
"preLaunchTask": "npm",
"env": {
"VSCODE_PHPUNIT_TEST": "true"
}
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceRoot}",
"${workspaceRoot}/src/test/php-project"
],
"outFiles": ["${workspaceFolder}/out/**/*.js", "!**/node_modules/**"],
"sourceMaps": true,
"preLaunchTask": "npm",
"smartStep": true
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/suite/index",
"${workspaceRoot}/src/test/php-project"
],
"outFiles": ["${workspaceFolder}/out/**/*.js", "!**/node_modules/**"],
"sourceMaps": true,
"preLaunchTask": "npm",
"env": {
"VSCODE_PHPUNIT_TEST": "true"
}
}
]
}
24 changes: 12 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"**/*.js": true,
"**/*.js.map": true
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib",
"FSharp.suggestGitignore": false,
"cmake.configureOnOpen": false // we want to use the TS server from our node_modules folder to control its version
}
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"**/*.js": true,
"**/*.js.map": true
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib",
"FSharp.suggestGitignore": false,
"cmake.configureOnOpen": false // we want to use the TS server from our node_modules folder to control its version
}
53 changes: 24 additions & 29 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,31 @@

// A task runner that calls a custom npm script that compiles the extension.
{
"version": "2.0.0",
"version": "2.0.0",

// we want to run npm
"command": "npm",
// we want to run npm
"command": "npm",

// we run the custom script "compile" as defined in package.json
"args": ["run", "compile", "--loglevel", "silent"],
// we run the custom script "compile" as defined in package.json
"args": ["run", "compile", "--loglevel", "silent"],

// The tsc compiler is started in watching mode
"isWatching": true,
// The tsc compiler is started in watching mode
"isWatching": true,

// use the standard tsc in watch mode problem matcher to find compile problems in the output.
"problemMatcher": "$tsc-watch",
"tasks": [
{
"label": "npm",
"type": "shell",
"command": "npm",
"args": [
"run",
"compile",
"--loglevel",
"silent"
],
"isBackground": true,
"problemMatcher": "$tsc-watch",
"group": {
"_id": "build",
"isDefault": false
}
}
]
}
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
"problemMatcher": "$tsc-watch",
"tasks": [
{
"label": "npm",
"type": "shell",
"command": "npm",
"args": ["run", "compile", "--loglevel", "silent"],
"isBackground": true,
"problemMatcher": "$tsc-watch",
"group": {
"_id": "build",
"isDefault": false
}
}
]
}
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# [4.4.0](https://github.com/elonmallin/vscode-phpunit/releases/tag/4.4.0)

- **Bugfix:** Wrap test suites with single quotes

# [v4.1.1](https://github.com/elonmallin/vscode-phpunit/releases/tag/v4.1.1)

- **Bugfix:** Don't stack up --color in the output command for each run.

# [v4.1.0](https://github.com/elonmallin/vscode-phpunit/releases/tag/v4.1.0)

- Handle `xml` files in `Run: Test` to enable running `<testsuites>` from `**phpunit.xml**` files.
- Add `Run: Test Suite` to quick pick from all `**phpunit.xml**` files and then quick pick from all `<testsuites>`.
- Add `phpunit.colors` setting to get colors by default `--colors=always`. Set to `null` or empty string to disable.
Expand All @@ -14,50 +17,60 @@
- **Bugfix:** Extract filename for test with `path.basename` instead of regex to cover more cases.

# [v4.0.1](https://github.com/elonmallin/vscode-phpunit/releases/tag/v4.0.1)

- **Bugfix:** Handle space in path for the filter arg of phpunit.
- **Bugfix:** Use the `phpunit.php` config if the path is found.

# [v4.0.0](https://github.com/elonmallin/vscode-phpunit/releases/tag/v4.0.0)

- **BREAKING CHANGE** Updated vscode engine version required to latest 1.27.0.
- Add color output and show failed tests in problems pane by running a task using a problem matcher.
- Add config property `phpunit.docker.image` for choosing docker image for `DockerDriver`.
- Add `DockerContainerDriver` to find running containers and pick from list.
- Add `phpunit.docker.container` to set running container to use for `DockerContainerDriver`.
- Add `phpunit.command` config for running custom commands in place of php. Such as custom docker commands.
- Add `phpunit.paths` to map paths for virtual environments. String replace with regex will be used for all paths in this config. Ex config:

```json
{
"/local/path": "/vitual/path",
"/second/local/path": "/second/virtual/path"
"/local/path": "/vitual/path",
"/second/local/path": "/second/virtual/path"
}
```

# [v3.1.0](https://github.com/elonmallin/vscode-phpunit/releases/tag/v3.1.0)

- Can now run php through docker. Will look for phpunit in all normal places (path, composer, phar).
- Add Stop running phpunit command (kill process).
- **Bugfix:** Prevent output window from stealing focus.
- Update vscode, typescript and other packages.

# [v3.0.0](https://github.com/elonmallin/vscode-phpunit/releases/tag/v3.0.0)

- Now uses global php if not set at `phpunit.php` (previously `phpunit.execPath`)
- `phpunit.execPath` still works for backwardscompatibility but is deprecated.
- Now tries to find phpunit in the project folder (composers vendor dir and .phar files).
- Will clear the output after each run (option: `clearOutputOnRun` default=true).

# [v2.2.1](https://github.com/elonmallin/vscode-phpunit/releases/tag/v2.2.1)

- Add command `phpunit.RerunLastCommand`. Will run the last command again and can be bound to hotkey.

# [v2.1.1](https://github.com/elonmallin/vscode-phpunit/releases/tag/v2.1.1)

- **Bugfix:** Function tests again allows `@test` docblocks and not just `test*` prefix.

# [v2.1.0](https://github.com/elonmallin/vscode-phpunit/releases/tag/v2.1.0)

- **Bugfix:** Run the instant tests reliably if the cursor is in the right place. Not every other try.
- Add config option preferRunClassTestOverQuickPickWindow (default: false). Set to true to never show the quick pick window and just test the whole class if the cursor is on anything other than a function name.

# [v2.0.1](https://github.com/elonmallin/vscode-phpunit/releases/tag/v2.0.1)

- **Bugfix:** Make sure the output channel is shown on test run.

# [v2.0.0](https://github.com/elonmallin/vscode-phpunit/releases/tag/v2.0.0)

- This release shows the quick pick window to select a test when you run "PHPUnit Test" not directly on a function or class. If you have the cursor directly on the class or function name it will run instantly just like in previous releases.

![vscode-phpunit-quick-pick](images/vscode-phpunit-quick-pick.gif)
Expand Down
3 changes: 1 addition & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Copyright (c) 2016, Elon Mallin


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading
Loading