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

Loosen some codeclimate checks #84

Merged
merged 1 commit into from Oct 30, 2018

Conversation

@thenaterhood
Copy link
Member

commented Oct 30, 2018

This is 100% up for discussion and right now is mostly experimentation. The idea, at least at the time of this writing, is to loosen the checks for duplication and similar code so they have fewer false positives.

I'm learning the configuration syntax as I go, so this might get interesting.

@Tjzabel
Copy link
Member

left a comment

Looks good to me! Teleirc uses a lot of very similar code, and therefore CodeClimate tends to "fail" on every PR.

Making the CC checks a little more relaxed would greatly improve the CI experience 👍
This is definitely something that I feel will have to be ongoing as we check how CC reacts to new PRs.

@Tjzabel Tjzabel merged commit 8931f1a into RITlug:master Oct 30, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jwflory jwflory modified the milestone: v1.2.1 Nov 4, 2018

jwflory added a commit that referenced this pull request Nov 23, 2018

Sadin added a commit to Sadin/teleirc that referenced this pull request Nov 28, 2018

Update fork (#2)
* Fix Dockerfile

* Only build CI against supported versions

* Resolve merge conflict

* Implement Sphinx documentation for Teleirc

* Update version number, expand authors, set node dependency

* Add CodeClimate support

* Remove MetaBrainz, add Pure Data (closes RITlug#54)

* Improve organization of project working directory

* Added CityZen app details

Added it first because i assumed the projects are added alphabetically.

* Add Hamara Linux Project

* Fix docker images

- Since dotenv is used, remove the gitignore and version the whole config.js file
- Fixes RITlug#60 -- add python and build-base to the alpine image
- Lower the UID by one to not conflict with nogroup in the alpine image
- Nuke the slim image as it adds very little benefit.
- Update docs accordingly
- Update yarn lock file
- Update docs to have users install yarn

* Update broken documentation link

* Add note to the installation docs that Telegram channels are not supported (RITlug#70)

* Fix link rot

* Nickserv identify (RITlug#65)

* NickServ identification + tests

* Ignoring direct messages + messages sent to other channels that the configured one

* NickServ identification will not happen when NickservService is empty in configuration
Also changes length comparison from "!=" to ">".

* Review findings addressed.

* Added bot nick to IDENTIFY message
* Added attempt to rejoin after a message from NickServ if not joined already (not tested yet)

* Crash on Telegram bot errors

* IRC Handler Refactor (RITlug#72)

* Added (untested) IrcHandlers.  These are so our IRC response logic is in separate classes, not in all one function.

The idea is maybe we can eventually make our IRC responses more advanced or configurable, and that is more easily doable through classes.

* Added Requires and and exports.

Added unit test for ErrorHandler.

* Added unit tests for the action handler.

* Added Kick and Join handler unit tests.

* Added unit tests for MessageHandler and PartHandler.

* Bind *all* the things (...thanks node...).

* Rename IrcHandlers so they have "Irc" in front of their names, so there is no mistake.

* Renamed classes so they have "IRC" in front so they are not confused with Telegram.

* Remove nodeunit... added it by accident.

* Added new lines at the end of the handler files.

* capital H... this is what I get for doing this on Windows...

* Added a helper function "StringExistsIgnoreCase".

This function is used to check for black-listed usernames, but can be used for other things as well.

* === instead of ==.

* Changed wording on joining a channel.

* ReportMessage -> RelayMessage

* Added (untested) IrcHandlers.  These are so our IRC response logic is in separate classes, not in all one function.

The idea is maybe we can eventually make our IRC responses more advanced or configurable, and that is more easily doable through classes.

* Added Requires and and exports.

Added unit test for ErrorHandler.

* Added unit tests for the action handler.

* Added Kick and Join handler unit tests.

* Added unit tests for MessageHandler and PartHandler.

* Bind *all* the things (...thanks node...).

* Rename IrcHandlers so they have "Irc" in front of their names, so there is no mistake.

* Renamed classes so they have "IRC" in front so they are not confused with Telegram.

* Remove nodeunit... added it by accident.

* Added new lines at the end of the handler files.

* capital H... this is what I get for doing this on Windows...

* Added a helper function "StringExistsIgnoreCase".

This function is used to check for black-listed usernames, but can be used for other things as well.

* === instead of ==.

* Changed wording on joining a channel.

* ReportMessage -> RelayMessage

* Integrated IrcNickServHandler into TeleIrc.js

Updated various unit tests so they work with it.

* Almost there... need to figure out this mock in IrcConnectionTest... it does not mock the IRC bot properly.

* Got the unit tests passing again.  This was done by having the mock IRC bot to take in multiple actions per listener, instead of just one.

Fixed an issue with the IrcMessageHandler, where it would forward messages that did not contain a channel.

* Added undefined check to nickservIdentify().

* Added comment to the 'status' function.

* Add Fedora CommOps, Diversity, Marketing as users (closes RITlug#75)

* Fix typo in hyperlink, missed from RITlug#79

* Gitignore change (RITlug#82)

* Allow new files in lib to be added via git.

At the moment, they were ignored since .gitignore was ignoring lib
because of the python virtual environment.

* Needed to put a slash in front...

* Wording.

* Just trying it out (RITlug#84)

* Check if we can actually reach Telegram on start (RITlug#83)

* Check if we can actually reach Telegram on start

* Fix tests

* Fix comment indentation

* No need for intermediate variable

* Telegram Refactor (RITlug#80)

* Added (untested) IrcHandlers.  These are so our IRC response logic is in separate classes, not in all one function.

The idea is maybe we can eventually make our IRC responses more advanced or configurable, and that is more easily doable through classes.

* Added Requires and and exports.

Added unit test for ErrorHandler.

* Added unit tests for the action handler.

* Added Kick and Join handler unit tests.

* Added unit tests for MessageHandler and PartHandler.

* Bind *all* the things (...thanks node...).

* Rename IrcHandlers so they have "Irc" in front of their names, so there is no mistake.

* Renamed classes so they have "IRC" in front so they are not confused with Telegram.

* Remove nodeunit... added it by accident.

* Added new lines at the end of the handler files.

* capital H... this is what I get for doing this on Windows...

* Added a helper function "StringExistsIgnoreCase".

This function is used to check for black-listed usernames, but can be used for other things as well.

* === instead of ==.

* Changed wording on joining a channel.

* ReportMessage -> RelayMessage

* Added (untested) IrcHandlers.  These are so our IRC response logic is in separate classes, not in all one function.

The idea is maybe we can eventually make our IRC responses more advanced or configurable, and that is more easily doable through classes.

* Added Requires and and exports.

Added unit test for ErrorHandler.

* Added unit tests for the action handler.

* Added Kick and Join handler unit tests.

* Added unit tests for MessageHandler and PartHandler.

* Bind *all* the things (...thanks node...).

* Rename IrcHandlers so they have "Irc" in front of their names, so there is no mistake.

* Renamed classes so they have "IRC" in front so they are not confused with Telegram.

* Remove nodeunit... added it by accident.

* Added new lines at the end of the handler files.

* capital H... this is what I get for doing this on Windows...

* Added a helper function "StringExistsIgnoreCase".

This function is used to check for black-listed usernames, but can be used for other things as well.

* === instead of ==.

* Changed wording on joining a channel.

* ReportMessage -> RelayMessage

* Integrated IrcNickServHandler into TeleIrc.js

Updated various unit tests so they work with it.

* Almost there... need to figure out this mock in IrcConnectionTest... it does not mock the IRC bot properly.

* Got the unit tests passing again.  This was done by having the mock IRC bot to take in multiple actions per listener, instead of just one.

Fixed an issue with the IrcMessageHandler, where it would forward messages that did not contain a channel.

* Added undefined check to nickservIdentify().

* Added comment to the 'status' function.

* Began to add Telegram classes.

* Added (completely untested) ErrorHandler, PhotoHandler, and StickerHandler for Telegram.

* Plugged in the TgEventListener and the handlers to TeleIrc.js.

Again, completely untested.

* Got unit tests passing again.

* Added TgDocumentHandler unit tests.

* Added TG Part/Join Handler unit tests.

* Added TG Message handler tests.

* new lines at end of files.

* Added unit tests for the sticker handler.

* Added photo handler unit tests.

* Got the Telegram refactor working when running via node.

#Success!

Now just to review and put in a pull.

* Put the chatId to be a string not an int.

* Rename CleanUpUserName -> ResolveUserName

* Never added TgImgurPhotoHandler.js

* Renamed "Report" functions to "Relay" Functions, per review.

* Use falseyness for the TG Handlers, per code review.

* Update yarn dependency tree

* Reorganize gitignore / add Dockerfile as ignored file

* Fix Fedora container, validate on Fedora 29 (closes RITlug#86)

This one wasn't too complicated, but took some playing around. What
changed here:

* Fix statements using old paths for files that no longer exist there
* Don't uninstall make, since it uninstalls nodejs
* yarn emits an error code, even if it actually was successful;
  therefore, run the next command regardless if it fails (this is why we
  can't have nice things :P)

* Set NTBA_FIX_319=1 in env.example (closes RITlug#88)

This resolves a deprecation warning given by node-telegram-bot-api about
the "automatic enabling of cancellation of promises". Given context from
the issue linked in the upstream project, setting this environment
variable will ensure backwards-compatibility with future releases. If we
need this feature, then we need to enable it when we need it.

Ref:

    yagop/node-telegram-bot-api#319 (comment)

* Fix CI tests: updated env.example path

* Use pipenv for docs development environment (RITlug#92)

Check it out:

  https://pipenv.readthedocs.io/

* Remove/update calls to retired method names (closes RITlug#87, closes RITlug#78) (RITlug#90)

* Remove redundant COPY statement from Fedora Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.