{"action":"created","issue":{"url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2305","repository_url":"https://api.github.com/repos/Minecolonies/minecolonies","labels_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2305/labels{/name}","comments_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2305/comments","events_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2305/events","html_url":"https://github.com/Minecolonies/minecolonies/pull/2305","id":304124253,"number":2305,"title":"Improvement/rework command processing","user":{"login":"mkienenb","id":6233921,"avatar_url":"https://avatars3.githubusercontent.com/u/6233921?v=4","gravatar_id":"","url":"https://api.github.com/users/mkienenb","html_url":"https://github.com/mkienenb","followers_url":"https://api.github.com/users/mkienenb/followers","following_url":"https://api.github.com/users/mkienenb/following{/other_user}","gists_url":"https://api.github.com/users/mkienenb/gists{/gist_id}","starred_url":"https://api.github.com/users/mkienenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkienenb/subscriptions","organizations_url":"https://api.github.com/users/mkienenb/orgs","repos_url":"https://api.github.com/users/mkienenb/repos","events_url":"https://api.github.com/users/mkienenb/events{/privacy}","received_events_url":"https://api.github.com/users/mkienenb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-11T02:29:28Z","updated_at":"2018-03-17T16:07:24Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2305","html_url":"https://github.com/Minecolonies/minecolonies/pull/2305","diff_url":"https://github.com/Minecolonies/minecolonies/pull/2305.diff","patch_url":"https://github.com/Minecolonies/minecolonies/pull/2305.patch"},"body":"# Changes proposed in this pull request:\r\n- Makes it easy to add/modify/delete existing commands and arguments for commands.\r\n- Centralizes code for parsing arguments and generating tab completions.\r\n- Tries to provide backwards-compatibility with existing command parser (now accessed with /mc_old)\r\n- Tries to provide backwards-compatibility for the quirks of each individual command.\r\n- Adds assertj fluent-style testing assertions.\r\n- Provides unit tests for several commands, both tab-completion and execution.\r\n- Added a new scan command as requested by raycoms\r\n\r\nNote that there are around 30 different commands.  I did not test most of them.  Furthermore, many of those commands take a variety of arguments.   I did test \"colony ownerchange\" and \"citizen info\" extensively with tests as well a a few others.\r\n\r\nThe documentation for individual commands and forge permissions for individual commands is mostly placeholder text and should be expanded.\r\n\r\nMost of the individual commands should be rewritten and the old version thrown out.\r\n\r\nRight now, parsing a colony argument of -1 will try to find the colony owned by the sender.   This may not be how the original command handled things.\r\n\r\nWe should probably support an \"OR\" argument type which will require one but not both of the argument types wrapped.   Currently would be helpful for commands which take a colony or a player to determine a colony.  Right now, I treat both arguments as optional and try to handle it in the code specific to the command -- it should be centrally-handled instead.\r\n\r\nDidn't get around to writing tests for BOOLEAN and INTEGER arguments yet.\r\n\r\nReview please, but realize that this probably will break something.\r\n"},"comment":{"url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/comments/373931573","html_url":"https://github.com/Minecolonies/minecolonies/pull/2305#issuecomment-373931573","issue_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2305","id":373931573,"user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"created_at":"2018-03-17T16:07:24Z","updated_at":"2018-03-17T16:07:24Z","author_association":"NONE","body":"\n![Codacy](https://app.codacy.com/assets/images/favicon.png) Here is an overview of what got changed by this pull request:\n\n\n```diff\n\nIssues\n======\n+ Solved 1\n- Added 22\n           \n\nComplexity increasing per file\n==============================\n- src/main/java/com/minecolonies/coremod/commands/colonycommands/ListColoniesCommand.java  2\n- src/main/java/com/minecolonies/coremod/commands/citizencommands/ListCitizensCommand.java  2\n         \n\nComplexity decreasing per file\n==============================\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/requestsystem/RSResetCommand.java  -2\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/DisableBarbarianSpawnsCommand.java  -2\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/DoRaidTonightCommand.java  -2\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/DoRaidNowCommand.java  -2\n+ src/main/java/com/minecolonies/coremod/commands/generalcommands/CheckForAutoDeletesCommand.java  -1\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/ShowColonyInfoCommand.java  -1\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/ChangeColonyOwnerCommand.java  -4\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/AddOfficerCommand.java  -2\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/DeleteColonyCommand.java  -3\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/ColonyTeleportCommand.java  -1\n+ src/main/java/com/minecolonies/coremod/commands/colonycommands/RefreshColonyCommand.java  -1\n         \n\nClones added\n============\n- src/main/java/com/minecolonies/coremod/commands/generalcommands/WhereAmICommand.java  1\n- src/main/java/com/minecolonies/coremod/commands/generalcommands/WhoAmICommand.java  1\n- src/main/java/com/minecolonies/coremod/commands/killcommands/AbstractKillCommand.java  2\n- src/main/java/com/minecolonies/coremod/commands/generalcommands/RaidAllNowCommand.java  2\n- src/main/java/com/minecolonies/coremod/commands/generalcommands/RaidAllTonightCommand.java  2\n- src/main/java/com/minecolonies/coremod/commands/colonycommands/DoRaidTonightCommand.java  1\n- src/main/java/com/minecolonies/coremod/commands/colonycommands/DoRaidNowCommand.java  1\n         \n```\n\n\nSee the complete overview on [Codacy](https://app.codacy.com/app/Minecolonies/minecolonies/pullRequest?prid=1419178&bid=6755627)\n        "}}
{"actor":{"display_login":"codacy-bot"}}