Skip to content
This repository has been archived by the owner on Mar 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #192 from DanielaSfregola/#20_add_scalafmt
Browse files Browse the repository at this point in the history
#20 Added scalafmt
  • Loading branch information
DanielaSfregola authored Jan 28, 2018
2 parents 71460d3 + 5d38d30 commit 02814c7
Show file tree
Hide file tree
Showing 195 changed files with 3,139 additions and 2,227 deletions.
1 change: 1 addition & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
maxColumn = 120
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
- SBT_OPTS = -XX:MaxPermSize=1024M -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled

script:
- sbt scalafmt::test test:scalafmt::test sbt:scalafmt::test # check files are formatted correctly
- travis_retry sbt clean coverage test coverageReport

after_success:
Expand Down
11 changes: 7 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ libraryDependencies ++= {
}

scalacOptions in ThisBuild ++= Seq("-language:postfixOps",
"-language:implicitConversions",
"-language:existentials",
"-feature",
"-deprecation")
"-language:implicitConversions",
"-language:existentials",
"-feature",
"-deprecation")

lazy val standardSettings = Seq(
organization := "com.danielasfregola",
Expand Down Expand Up @@ -96,6 +96,9 @@ lazy val coverageSettings = Seq(
coverageMinimum := 85
)

scalafmtOnCompile in ThisBuild := true
scalafmtTestOnCompile in ThisBuild := true

siteSubdirName in SiteScaladoc := version + "/api"

lazy val root = (project in file("."))
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")

addSbtPlugin("com.lucidchart" % "sbt-scalafmt-coursier" % "1.15")

parallelExecution in Test := false
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class TwitterAuthenticationClient(val consumerToken: ConsumerToken) extends Twit

}

trait TwitterAuthClients
extends TwitterOAuthClient
trait TwitterAuthClients extends TwitterOAuthClient

object TwitterAuthenticationClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ class TwitterStreamingClient(val consumerToken: ConsumerToken, val accessToken:

}

trait StreamingClients
extends TwitterStatusClient
with TwitterUserClient
with TwitterSiteClient
trait StreamingClients extends TwitterStatusClient with TwitterUserClient with TwitterSiteClient

object TwitterStreamingClient {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.danielasfregola.twitter4s.entities

final case class Configuration(dm_text_character_limit: Long,
characters_reserved_per_media: Int,
max_media_per_upload: Int,
non_username_paths: Seq[String] = Seq.empty,
photo_size_limit: Long,
photo_sizes: Map[String, Size] = Map.empty,
short_url_length: Int,
short_url_length_https: Int)
characters_reserved_per_media: Int,
max_media_per_upload: Int,
non_username_paths: Seq[String] = Seq.empty,
photo_size_limit: Long,
photo_sizes: Map[String, Size] = Map.empty,
short_url_length: Int,
short_url_length_https: Int)
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@ import java.util.Date
import com.danielasfregola.twitter4s.entities.streaming.UserStreamingMessage

final case class DirectMessage(created_at: Date,
entities: Option[Entities],
id: Long,
id_str: String,
recipient: User,
recipient_id: Long,
recipient_id_str: String,
recipient_screen_name: String,
sender: User,
sender_id: Long,
sender_id_str: String,
sender_screen_name: String,
text: String) extends UserStreamingMessage







entities: Option[Entities],
id: Long,
id_str: String,
recipient: User,
recipient_id: Long,
recipient_id_str: String,
recipient_screen_name: String,
sender: User,
sender_id: Long,
sender_id_str: String,
sender_screen_name: String,
text: String)
extends UserStreamingMessage
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ package com.danielasfregola.twitter4s.entities
// unfortunately Twitter is not consistent when representing this entity...

final case class Entities(hashtags: Seq[HashTag] = Seq.empty,
media: Seq[Media] = Seq.empty,
symbols: Seq[Symbol] = Seq.empty,
url: Option[Urls] = None,
urls: Seq[UrlDetails] = Seq.empty,
user_mentions: Seq[UserMention] = Seq.empty,
description: Option[Urls] = None)
media: Seq[Media] = Seq.empty,
symbols: Seq[Symbol] = Seq.empty,
url: Option[Urls] = None,
urls: Seq[UrlDetails] = Seq.empty,
user_mentions: Seq[UserMention] = Seq.empty,
description: Option[Urls] = None)

final case class Urls(urls: Seq[UrlDetails] = Seq.empty)

final case class UrlDetails(url: String, expanded_url: String, display_url: String, indices: Seq[Int])



Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package com.danielasfregola.twitter4s.entities

final case class GeoPlace(attributes: Map[String, String],
bounding_box: Area,
country: String,
country_code: String,
full_name: String,
id: String,
name: String,
place_type: String,
url: String,
contained_within: Seq[GeoPlace],
centroid: Seq[Double] = Seq.empty,
polylines: Seq[String] = Seq.empty)

bounding_box: Area,
country: String,
country_code: String,
full_name: String,
id: String,
name: String,
place_type: String,
url: String,
contained_within: Seq[GeoPlace],
centroid: Seq[Double] = Seq.empty,
polylines: Seq[String] = Seq.empty)
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ final case class GeoQuery(params: GeoParams, `type`: String, url: String)
final case class GeoResult(places: Seq[GeoPlace] = Seq.empty)

final case class GeoParams(accuracy: String,
granularity: String,
coordinates: Option[Coordinates] = None,
query: Option[String] = None,
autocomplete: Boolean = false,
trim_place: Boolean = false)

granularity: String,
coordinates: Option[Coordinates] = None,
query: Option[String] = None,
autocomplete: Boolean = false,
trim_place: Boolean = false)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.danielasfregola.twitter4s.entities

final case class Location(country: String,
countryCode: Option[String],
name: String,
parentid: Long,
placeType: PlaceType,
url: String,
woeid: Long)
countryCode: Option[String],
name: String,
parentid: Long,
placeType: PlaceType,
url: String,
woeid: Long)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.danielasfregola.twitter4s.entities

final case class LocationTrends(as_of: String, // TODO - convert to Date? Different date format here...
created_at: String, // TODO - convert to Date? Different date format here...
locations: Seq[LocationOverview] = Seq.empty,
trends: Seq[Trend] = Seq.empty)
created_at: String, // TODO - convert to Date? Different date format here...
locations: Seq[LocationOverview] = Seq.empty,
trends: Seq[Trend] = Seq.empty)

final case class LocationOverview(name: String, woeid: Long)

// TODO - support 'promoted_content' and 'events'
final case class Trend(name: String, query: String, url: String,tweet_volume:Option[Long])
final case class Trend(name: String, query: String, url: String, tweet_volume: Option[Long])
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ final case class LookupEntities(url: LookupUrls, description: LookupUrls)

final case class LookupUrls(urls: Seq[LookupUrl])

final case class LookupUrl( url: String, expanded_url: String, display_url: String, indices: Seq[Int])

final case class LookupUrl(url: String, expanded_url: String, display_url: String, indices: Seq[Int])
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.danielasfregola.twitter4s.entities

final case class LookupRelationship(connections: Seq[String] = Seq.empty,
id: Long,
id_str: String,
name: String,
screen_name: String)
id: Long,
id_str: String,
name: String,
screen_name: String)
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,27 @@ package com.danielasfregola.twitter4s.entities
import java.util.Date

final case class LookupTweet(
contributors: Seq[Contributor],
coordinates: Seq[Seq[Seq[Double]]] = Seq.empty,
created_at: Date,
entities: Option[Entities],
favorite_count: Int = 0,
favorited: Boolean = false,
id: Long,
id_str: String,
in_reply_to_screen_name: Option[String],
in_reply_to_status_id: Option[Long],
in_reply_to_status_id_str: Option[String],
in_reply_to_user_id: Option[Long],
in_reply_to_user_id_str: Option[String],
is_quote_status: Boolean = false,
lang: Option[String],
place: Option[GeoPlace],
possibly_sensitive: Boolean = false,
retweet_count: Long = 0,
retweeted: Boolean = false,
source: String,
text: String,
truncated: Boolean = false,
user: Option[LookupUser]
)



contributors: Seq[Contributor],
coordinates: Seq[Seq[Seq[Double]]] = Seq.empty,
created_at: Date,
entities: Option[Entities],
favorite_count: Int = 0,
favorited: Boolean = false,
id: Long,
id_str: String,
in_reply_to_screen_name: Option[String],
in_reply_to_status_id: Option[Long],
in_reply_to_status_id_str: Option[String],
in_reply_to_user_id: Option[Long],
in_reply_to_user_id_str: Option[String],
is_quote_status: Boolean = false,
lang: Option[String],
place: Option[GeoPlace],
possibly_sensitive: Boolean = false,
retweet_count: Long = 0,
retweeted: Boolean = false,
source: String,
text: String,
truncated: Boolean = false,
user: Option[LookupUser]
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@ package com.danielasfregola.twitter4s.entities
import java.util.Date

final case class LookupUser(
contributors_enabled: Boolean = false,
created_at: Date,
default_profile: Boolean = false,
default_profile_image: Boolean = false,
description: Option[String] = None,
entities: Option[LookupEntities] = None,
favourites_count: Int,
follow_request_sent: Boolean = false,
following: Boolean = false,
followers_count: Int,
friends_count: Int,
geo_enabled: Boolean = false,
has_extended_profile: Boolean = false,
id: Long,
id_str: String,
is_translator: Boolean = false,
is_translation_enabled: Boolean = false,
lang: String,
listed_count: Int,
location: Option[String] = None,
name: String,
notifications: Boolean = false,
profile_background_color: String,
profile_background_image_url: String,
profile_background_image_url_https: String,
profile_background_tile: Boolean = false,
profile_banner_url: Option[String] = None,
profile_image_url: ProfileImage,
profile_image_url_https: ProfileImage,
profile_link_color: String,
profile_sidebar_border_color: String,
profile_sidebar_fill_color: String,
profile_text_color: String,
profile_use_background_image: Boolean = false,
`protected`: Boolean = false,
screen_name: String,
statuses_count: Int,
time_zone: Option[String] = None,
url: Option[String] = None,
utc_offset: Option[Int] = None,
verified: Boolean = false,
withheld_in_countries: Option[String] = None,
withheld_scope: Option[String] = None
)
contributors_enabled: Boolean = false,
created_at: Date,
default_profile: Boolean = false,
default_profile_image: Boolean = false,
description: Option[String] = None,
entities: Option[LookupEntities] = None,
favourites_count: Int,
follow_request_sent: Boolean = false,
following: Boolean = false,
followers_count: Int,
friends_count: Int,
geo_enabled: Boolean = false,
has_extended_profile: Boolean = false,
id: Long,
id_str: String,
is_translator: Boolean = false,
is_translation_enabled: Boolean = false,
lang: String,
listed_count: Int,
location: Option[String] = None,
name: String,
notifications: Boolean = false,
profile_background_color: String,
profile_background_image_url: String,
profile_background_image_url_https: String,
profile_background_tile: Boolean = false,
profile_banner_url: Option[String] = None,
profile_image_url: ProfileImage,
profile_image_url_https: ProfileImage,
profile_link_color: String,
profile_sidebar_border_color: String,
profile_sidebar_fill_color: String,
profile_text_color: String,
profile_use_background_image: Boolean = false,
`protected`: Boolean = false,
screen_name: String,
statuses_count: Int,
time_zone: Option[String] = None,
url: Option[String] = None,
utc_offset: Option[Int] = None,
verified: Boolean = false,
withheld_in_countries: Option[String] = None,
withheld_scope: Option[String] = None
)
Loading

0 comments on commit 02814c7

Please sign in to comment.