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

Convert the testmethod modifier to the @IsTest annotation #19

Merged

Conversation

IlyaMatsuev
Copy link
Owner

@IlyaMatsuev IlyaMatsuev commented Dec 23, 2022

This PR makes all testmethod modifiers be deleted and replaced with the @IsTest annotation if the apexFormatAnnotations option is enabled.

  • I’ve added tests to confirm my change works.
  • (If changing formatting output/API or CLI) I’ve added my changes to the CHANGELOG.md file in the Unreleased section.
  • I’ve read the contributing guidelines.

@IlyaMatsuev IlyaMatsuev added the enhancement New feature or request label Dec 23, 2022
@IlyaMatsuev IlyaMatsuev self-assigned this Dec 23, 2022
@IlyaMatsuev IlyaMatsuev linked an issue Dec 23, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2022

Codecov Report

Base: 99.22% // Head: 99.22% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (a69ce91) compared to base (12a4224).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@               Coverage Diff                @@
##           ilyamatsuev/dev      #19   +/-   ##
================================================
  Coverage            99.22%   99.22%           
================================================
  Files                    7        7           
  Lines                 2693     2706   +13     
  Branches               586      593    +7     
================================================
+ Hits                  2672     2685   +13     
  Misses                  20       20           
  Partials                 1        1           
Impacted Files Coverage Δ
src/index.ts 100.00% <ø> (ø)
src/constants.ts 100.00% <100.00%> (ø)
src/printer.ts 99.61% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@IlyaMatsuev IlyaMatsuev merged commit 0886d56 into ilyamatsuev/dev Dec 23, 2022
@IlyaMatsuev IlyaMatsuev deleted the feature/convert-testmethod-modifier-to-annotaiton branch December 23, 2022 18:44
IlyaMatsuev added a commit that referenced this pull request Feb 11, 2023
* private is added to method params if they are final (#15)

* Remove default access modifier handling for parameters
* Update changelog

* webservice modifier conflicts with apexExplicitAccessModifier (#16)

* Make webservice and testmethod always lowercase
* Exclude webservice methods from setting default modifier

* Sync with upstream (#17)

* Update dependency @types/node to v18.11.8

* Update typescript-eslint monorepo to v5.42.0

* Update dependency @types/jest to v29.2.1

* Update dependency @types/node to v18.11.9

* Update dependency @types/jest to v29.2.2

* Updated jorje (dangmai#687)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency eslint to v8.27.0

* Update typescript-eslint monorepo to v5.42.1

* Update dependency jest to v29.3.0

* Update dependency ts-migrate to v0.1.35

* Update dependency jest to v29.3.1

* Fix dangmai#693 - Binaryish expressions having wrong indentations inside parentheses

* Add comment about input parameter handling

* Remove ts-migrate dependency

* Fix dangmai#688 - Keep original position for comments in-between If-Else and Try-Catch blocks

* Update typescript-eslint monorepo to v5.43.0

* Update dependency @types/jest to v29.2.3

* Update dependency typescript to v4.9.3

* Fix dangmai#698 - Add breaking change about script location to CHANGELOG

* Updated jorje (dangmai#701)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency eslint to v8.28.0

* Update typescript-eslint monorepo to v5.44.0

* Update peter-evans/create-pull-request action to v4.2.1

* Update dependency prettier to v2.8.0

* Update peter-evans/create-pull-request action to v4.2.2

* [vscode] remove NPM extension from recommendation

* Updated jorje (dangmai#707)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Updated jorje (dangmai#708)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update peter-evans/create-pull-request action to v4.2.3

* Update typescript-eslint monorepo to v5.45.0

* Update dependency @types/node to v18.11.10

* Update dependency eslint to v8.29.0

* Use `yarn` instead of `npm` for dep management

* Use yarnhook to streamline dev dependency installation

* Fix Jest globalSetup & globalTeardown not working correctly

* Fix ESLint issues with start & stop test server scripts

* Fix ESLint issues with start and stop apex server scripts

* Add package tests

* Fix run-package-tests errors

* Add missing closing parenthesis to Workflow

* Remove extraneous '--' in Yarn commands

* Final CHANGELOG for 1.12.0

* 1.12.0

* Fix ignore-list.txt location

* Fix path to EDA unpackaged directory

* Add workaround for INPUT_TOKEN env var not being populated

* Update dependency @types/jest to v29.2.4

* Update typescript-eslint monorepo to v5.45.1

* Update dependency @types/node to v18.11.11

* Update dependency prettier to v2.8.1

* Update dependency typescript to v4.9.4

* Update typescript-eslint monorepo to v5.46.0

* Update dependency @types/node to v18.11.12

* Updated jorje (dangmai#724)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Add optional start-apex-server flag for allowed CORS origins

* Pipe apex-ast-serializer logs to console

* Fix linting issue with files not formatted correctly

* Update dependency @types/node to v18.11.13

* Install husky hooks in postinstall

* Use new husky syntax

* Update typescript-eslint monorepo to v5.46.1

* Update dependency @types/node to v18.11.14

* Update dependency @types/node to v18.11.15

* Updated jorje (dangmai#725)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency @types/node to v18.11.16

* Update dependency eslint to v8.30.0

* Update dependency @types/node to v18.11.17

* Update dependency wait-on to v7 (dangmai#730)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update typescript-eslint monorepo to v5.47.0

* Update husky scripts

* Fix tests

* Add examples

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dang Mai <contact@dangmai.net>
Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* A modifier is deleted from the method declaration when annotation is followed by a comment (#18)

* Fix dangling comments for apexSortModifiers option

* Include sfdx folder to gitignore

* Update changelog

* Convert the `testmethod` modifier to the `@IsTest` annotation (#19)

* Replace testmethod modifier with the annotation

* Replace testmethod with @istest

* Fix unit tests

* Make the testmethod modifier convertion optional

* Update changelog

* Update build status badge

* Prevent apexExplicitAccessModifier feature for triggers (#21)

Co-authored-by: Ilya Matsuev <ilya.matsuev@kpn.com>

* Update changelog for the latest bugfix

* Sync with upstream (#23)

* Update dependency @types/node to v18.11.8

* Update typescript-eslint monorepo to v5.42.0

* Update dependency @types/jest to v29.2.1

* Update dependency @types/node to v18.11.9

* Update dependency @types/jest to v29.2.2

* Updated jorje (dangmai#687)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency eslint to v8.27.0

* Update typescript-eslint monorepo to v5.42.1

* Update dependency jest to v29.3.0

* Update dependency ts-migrate to v0.1.35

* Update dependency jest to v29.3.1

* Fix dangmai#693 - Binaryish expressions having wrong indentations inside parentheses

* Add comment about input parameter handling

* Remove ts-migrate dependency

* Fix dangmai#688 - Keep original position for comments in-between If-Else and Try-Catch blocks

* Update typescript-eslint monorepo to v5.43.0

* Update dependency @types/jest to v29.2.3

* Update dependency typescript to v4.9.3

* Fix dangmai#698 - Add breaking change about script location to CHANGELOG

* Updated jorje (dangmai#701)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency eslint to v8.28.0

* Update typescript-eslint monorepo to v5.44.0

* Update peter-evans/create-pull-request action to v4.2.1

* Update dependency prettier to v2.8.0

* Update peter-evans/create-pull-request action to v4.2.2

* [vscode] remove NPM extension from recommendation

* Updated jorje (dangmai#707)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Updated jorje (dangmai#708)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update peter-evans/create-pull-request action to v4.2.3

* Update typescript-eslint monorepo to v5.45.0

* Update dependency @types/node to v18.11.10

* Update dependency eslint to v8.29.0

* Use `yarn` instead of `npm` for dep management

* Use yarnhook to streamline dev dependency installation

* Fix Jest globalSetup & globalTeardown not working correctly

* Fix ESLint issues with start & stop test server scripts

* Fix ESLint issues with start and stop apex server scripts

* Add package tests

* Fix run-package-tests errors

* Add missing closing parenthesis to Workflow

* Remove extraneous '--' in Yarn commands

* Final CHANGELOG for 1.12.0

* 1.12.0

* Fix ignore-list.txt location

* Fix path to EDA unpackaged directory

* Add workaround for INPUT_TOKEN env var not being populated

* Update dependency @types/jest to v29.2.4

* Update typescript-eslint monorepo to v5.45.1

* Update dependency @types/node to v18.11.11

* Update dependency prettier to v2.8.1

* Update dependency typescript to v4.9.4

* Update typescript-eslint monorepo to v5.46.0

* Update dependency @types/node to v18.11.12

* Updated jorje (dangmai#724)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Add optional start-apex-server flag for allowed CORS origins

* Pipe apex-ast-serializer logs to console

* Fix linting issue with files not formatted correctly

* Update dependency @types/node to v18.11.13

* Install husky hooks in postinstall

* Use new husky syntax

* Update typescript-eslint monorepo to v5.46.1

* Update dependency @types/node to v18.11.14

* Update dependency @types/node to v18.11.15

* Updated jorje (dangmai#725)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency @types/node to v18.11.16

* Update dependency eslint to v8.30.0

* Update dependency @types/node to v18.11.17

* Update dependency wait-on to v7 (dangmai#730)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update typescript-eslint monorepo to v5.47.0

* Update dependency @types/node to v18.11.18

* Update typescript-eslint monorepo to v5.47.1

* Update dependency @types/jest to v29.2.5

* Update dependency eslint to v8.31.0

* Update dependency eslint-config-prettier to v8.6.0

* Update typescript-eslint monorepo to v5.48.0

* Update dependency husky to v8.0.3

* Update actions/setup-node action to v3.6.0

* Update dependency prettier to v2.8.2

* Bump json5 from 1.0.1 to 1.0.2 (dangmai#745)

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update typescript-eslint monorepo to v5.48.1

* Update dependency ts-jest to v29.0.4

* Update dependency eslint-plugin-import to v2.27.4

* Update dependency ts-jest to v29.0.5

* Update dependency prettier to v2.8.3

* Update dependency rimraf to v4 (dangmai#751)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency rimraf to v4.0.5

* Updated jorje (dangmai#735)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency eslint to v8.32.0

* Update dependency rimraf to v4.0.7

* Update typescript-eslint monorepo to v5.48.2

* Update dependency eslint-plugin-import to v2.27.5

* Update dependency rimraf to v4.1.0

* Update dependency rimraf to v4.1.1

* Update dependency @types/jest to v29.2.6

* Update typescript-eslint monorepo to v5.49.0

* Update dependency rimraf to v4.1.2

* Update dependency jest to v29.4.0

* Update dependency @types/jest to v29.4.0

* Update dependency jest to v29.4.1

* Update dependency eslint to v8.33.0

* Update dependency typescript to v4.9.5

* Update typescript-eslint monorepo to v5.50.0

* Updated jorje (dangmai#771)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency @types/node to v18.11.19

* Update typescript-eslint monorepo to v5.51.0

* Updated jorje (dangmai#774)

Co-authored-by: dangmai <dangmai@users.noreply.github.com>

* Update dependency @types/node to v18.13.0

* Update dependency jest to v29.4.2

* Update dependency prettier to v2.8.4

* [chore] enable renovate lockFileMaintenance

* [chore] fix renovate config

* Lock file maintenance

* Update dependency eslint to v8.34.0

* Fix vendor jars

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dang Mai <contact@dangmai.net>
Co-authored-by: dangmai <dangmai@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dang Mai <contact@dangmai.net>
Co-authored-by: dangmai <dangmai@users.noreply.github.com>
Co-authored-by: Ilya Matsuev <ilya.matsuev@kpn.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Convert testmethod modifiers to @IsTest annotations
2 participants