Swift Codable JSON:API framework
A library that adds support for generating OpenAPI compliant documentation from JSON API compliant models.
mattpolzin/jsonapi-openapi-test-server 5
Server that builds a OpenAPI/JSON:API Swift test suite and runs it.
The fastest JSON Schema Validator. Supports draft-04/06/07
👤 Authentication and Authorization framework for Fluent.
A standalone Swift version of LLVM's flexible pattern matching file verifier
mattpolzin/fluent-postgresql 1
🖋🐘 Swift ORM (queries, models, relations, etc) built on PostgreSQL.
A simple parser combinator written in Swift
Random Idris 2 stuff that might be generally useful to me in the future.
A specification for building JSON APIs
issue openedSwiftDocOrg/swift-doc
Checking completeness of documentation using coverage
Hi guys,
I have no idea if this is the correct section to ask this I have a couple of questions, feel free to close this if this is not appropriate to do so here.
I am very interested in the "coverage" part of the tool. I would like to check that all documentation is up to date and complete. Now when I create a test class with some methods and play around with the method signatures but keep the old documentation (this either doesn't have the correct parameters anymore or names have changed/new ones are added) the coverage still tells me that it's 100% as long as there is anything documented.
I would like to ask if there is a possibility to check that the documentation is present and all parameters are documented (and no "old" parameters are documented).
It would also be really nice if there would be an option to also include non public methods/classes in the coverage report, maybe with a separate flag?
Many thanks for all the effort that has been put into this project!
created time in an hour
issue closedmichaelbull/kotlin-result
Typo in wiki for checking if result is an error
The Elm page has this example:
val result = Err(500)
if (result is Error) {
println("Result is not ok")
}
I guess it should be
...
if (result is Err) {
...
closed time in an hour
stigkjissue commentmichaelbull/kotlin-result
Typo in wiki for checking if result is an error
Good catch! Fixed, thanks.
comment created time in an hour
issue openedmichaelbull/kotlin-result
Typo in wiki for checking if result is an error
The Elm page has this example:
val result = Err(500)
if (result is Error) {
println("Result is not ok")
}
I guess it should be
...
if (result is Err) {
...
created time in 2 hours
issue commentSwiftDocOrg/swift-doc
dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib
This doesn't work for me unfortunately. Any updates on how to fix this? Trying to run the swiftdoc tests on a local fork
comment created time in 2 hours
issue commentidris-lang/Idris2
Small executable to fix whitespace issues
A first (hopefully) working version of an Idris program can be found here. Although I do not know whether we still need this, it might still be useful. So far, I only tested this on Linux. Have fun.
While writing this, I came up with a port of Haskell's GetOpt module. This could probably go to contrib. I'll write a PR if there is any interest.
I used some monad transformers form base (ReaderT
and EitherT
) and found that there are quite a few transformer instances missing. For instance, there is no MonadReader
instance for StateT
nor is there a MonadState
instance for ReaderT. Again, if there is any interest, I could draft a PR for adding these missing instances.
comment created time in 3 hours
issue commentmichaelbull/kotlin-result
Multiplatform ArtifactNotFouundException
have been getting similar issue with one of my own projects... as best I can tell this is an issue when the Multiplatform project has a target for android()
. The functionality was added to the Jetbrains/android project back in Feb 2020, see https://github.com/JetBrains/android/commit/d311db0523c2f04c10a0e9386e4256406f5f29ab
comment created time in 5 hours
push eventTokamakUI/Tokamak
commit sha 1330b5306bdf920078e59488350d0996bbb73eb5
Removed an extra space that cause Safari to issue "Invalid value" errors and not load the pages (#358) An extra space was added at the beginning of the 'ry' attribute value of a rect. Safari reported: Error: Invalid value for <rect> attribute ry=" 25.0".
push time in 6 hours
PR merged TokamakUI/Tokamak
An extra space was added at the beginning of the 'ry' attribute value of a rect. Safari reported: Error: Invalid value for <rect> attribute ry=" 25.0".
pr closed time in 6 hours
push eventTokamakUI/Tokamak
commit sha 6955e56f778857be2710d04756cf8d9574842d37
Fixed a small issue with re-renderers being dropped (#356) The code was clearing the queuedRerenders set after processing all of the updates on each re-renderer. However, during processing it is possible that new values were enqueued. By clearing the set afterwards, these newly queued re-renderers were accidentally dropped. This would cause some Views to not update when @State was changed.
push time in 6 hours
PR merged TokamakUI/Tokamak
The code was clearing the queuedRerenders set after processing all of the updates on each re-renderer. However, during processing it is possible that new values were enqueued. By clearing the set afterwards, these newly queued re-renderers were accidentally dropped.
This would cause some Views to not update when @State was changed.
pr closed time in 6 hours
PR opened TokamakUI/Tokamak
An extra space was added at the beginning of the 'ry' attribute value of a rect. Safari reported: Error: Invalid value for <rect> attribute ry=" 25.0".
pr created time in 7 hours
issue openedTokamakUI/Tokamak
Generate `NativeDemo` Xcode project with xcodegen or tuist
For future reference: https://github.com/yonaskolb/XcodeGen https://github.com/tuist/tuist/
We just see that people forget adding new demo files to the demo Xcode project, and this can and should be automated after all.
created time in 7 hours
pull request commentTokamakUI/Tokamak
Add support for shadow modifier
@literalpie to fix the macOS build you'll have to open the demo Xcode project (in the NativeDemo
subdirectory) and add the new ShadowDemo
file to it.
comment created time in 7 hours
PR opened TokamakUI/Tokamak
The code was clearing the queuedRerenders set after processing all of the updates on each re-renderer. However, during processing it is possible that new values were enqueued. By clearing the set afterwards, these newly queued re-renderers were accidentally dropped.
This would cause some Views to not update when @State was changed.
pr created time in 7 hours
issue commentidris-lang/Idris2
Small executable to fix whitespace issues
Even Vim and Emacs
Well, I'm as a vim user knew about editorconfig only by the pull request #932. Then I knew that vim needs a plugin to support it. It's great and I installed it but still it's easy to use vim without this plugin.
So, maybe, we need at least mention usage of such plugins somewhere. But where? CONTRIBUTING.md
contains things that are needed, but not guidelines or rules of contributions.
comment created time in 8 hours
issue commentidris-lang/Idris2
Small executable to fix whitespace issues
Virtually all editors/IDEs support editorconfig nowadays. Even Vim and Emacs.
Good to know. The addition of editorconfig is really recent so maybe the errors we got in the past few days were leftovers from PRs opened prior to that addition.
comment created time in 8 hours
push eventidris-lang/Idris2
commit sha 2eb8f4149ce50e1a97c19ceb1283cb2826f35875
idris2 --help now prints env variables used by the compiler Until yesterday I did not know Idris2 accesses environment variables. Mentioning them in `--help` would educate other users. Not all descriptions make sense, I tried my best to guess them. Output is: [link](https://gist.github.com/stepancheg/7d1dff344a0dd35b9d07fb4a417ecb32).
push time in 8 hours
PR merged idris-lang/Idris2
Until yesterday I did not know Idris2 accesses environment variables.
Mentioning them in --help
would educate other users.
Not all descriptions make sense, I tried my best to guess them.
Output is: link.
pr closed time in 8 hours
push eventidris-lang/Idris2
commit sha 7264d40c569b2fcd2fa17224cf149c3872c9688a
Make isElem, DecEq public, not just export ... so they could be used in proof search. Follow-up to #942
push time in 8 hours
PR merged idris-lang/Idris2
... so they could be used in proof search.
Follow-up to #942
pr closed time in 8 hours
Pull request review commentvapor/redis
Support for Multiple Redis instances
+import Vapor++extension Application {+ private struct RedisStorageKey: StorageKey {+ typealias Value = RedisStorage+ }+ var redisStorage: RedisStorage {+ if self.storage[RedisStorageKey.self] == nil {+ let redisStorage = RedisStorage()+ self.storage[RedisStorageKey.self] = redisStorage+ self.lifecycle.use(RedisStorage.Lifecycle(redisStorage: redisStorage))+ }+ return self.storage[RedisStorageKey.self]!+ }+}++class RedisStorage {+ private var lock: Lock+ private var configurations: [RedisID: RedisConfiguration]+ fileprivate var pools: [PoolKey: RedisConnectionPool] {+ willSet {+ guard pools.isEmpty else {+ fatalError("editing pools after application has booted is not supported")+ }+ }+ }++ init() {+ self.configurations = [:]+ self.pools = [:]+ self.lock = .init()+ }++ func use(_ redisConfiguration: RedisConfiguration, as id: RedisID = .default) {+ self.configurations[id] = redisConfiguration+ }++ func configuration(for id: RedisID = .default) -> RedisConfiguration? {+ self.configurations[id]+ }++ func ids() -> Set<RedisID> {+ Set(self.configurations.keys)+ }++ func pool(for eventLoop: EventLoop, id redisID: RedisID) -> RedisConnectionPool {+ let key = PoolKey(eventLoopKey: eventLoop.key, redisID: redisID)+ guard let pool = pools[key] else {+ fatalError("No redis found for id \(redisID), or the app may not have finished booting. Also, the eventLoop must be from Application's EventLoopGroup.")+ }+ return pool+ }+++}++extension RedisStorage {+ /// Lifecyle Handler for Redis Storage. On boot, it creates a RedisConnectionPool for each+ /// configurated `RedisID` on each `EventLoop`.+ class Lifecycle: LifecycleHandler {
final class Lifecycle: LifecycleHandler {
comment created time in 9 hours
Pull request review commentvapor/redis
Support for Multiple Redis instances
+import Vapor++extension Application {+ private struct RedisStorageKey: StorageKey {+ typealias Value = RedisStorage+ }+ var redisStorage: RedisStorage {+ if self.storage[RedisStorageKey.self] == nil {+ let redisStorage = RedisStorage()+ self.storage[RedisStorageKey.self] = redisStorage+ self.lifecycle.use(RedisStorage.Lifecycle(redisStorage: redisStorage))+ }+ return self.storage[RedisStorageKey.self]!+ }+}++class RedisStorage {
final class RedisStorage {
comment created time in 9 hours
Pull request review commentvapor/redis
Support for Multiple Redis instances
+import Foundation+import Redis+import Vapor+import Logging+import XCTVapor++fileprivate extension RedisID {+ static let one: RedisID = "one"+ static let two: RedisID = "two"+}++class MultipleRedisTests: XCTestCase {++ var redisConfig: RedisConfiguration!+ var redisConfig2: RedisConfiguration!++ override func setUpWithError() throws {+ try super.setUpWithError()++ redisConfig = try RedisConfiguration(hostname: Environment.get("REDIS_HOSTNAME") ?? "localhost",+ port: Environment.get("REDIS_PORT")?.int ?? 6379)+ redisConfig2 = try RedisConfiguration(hostname: Environment.get("REDIS_HOSTNAME_2") ?? "localhost",+ port: Environment.get("REDIS_PORT_2")?.int ?? 6380)
please follow Vapor style, see also my comment in RedisTests.swift
comment created time in 10 hours
Pull request review commentvapor/redis
Support for Multiple Redis instances
+import Foundation+import Redis+import Vapor+import Logging+import XCTVapor++fileprivate extension RedisID {+ static let one: RedisID = "one"+ static let two: RedisID = "two"+}++class MultipleRedisTests: XCTestCase {++ var redisConfig: RedisConfiguration!+ var redisConfig2: RedisConfiguration!++ override func setUpWithError() throws {+ try super.setUpWithError()++ redisConfig = try RedisConfiguration(hostname: Environment.get("REDIS_HOSTNAME") ?? "localhost",+ port: Environment.get("REDIS_PORT")?.int ?? 6379)+ redisConfig2 = try RedisConfiguration(hostname: Environment.get("REDIS_HOSTNAME_2") ?? "localhost",+ port: Environment.get("REDIS_PORT_2")?.int ?? 6380)+ }++ func testApplicationRedis() throws {+ let app = Application()+ defer { app.shutdown() }++ app.redis(.one).configuration = redisConfig+ app.redis(.two).configuration = redisConfig2++ try app.boot()++ let info1 = try app.redis(.one).send(command: "INFO").wait()+ XCTAssertContains(info1.string, "redis_version")++ let info2 = try app.redis(.two).send(command: "INFO").wait()+ XCTAssertContains(info2.string, "redis_version")+ }++ +
newlines
comment created time in 10 hours
Pull request review commentvapor/redis
Support for Multiple Redis instances
+import Foundation+import Redis+import Vapor+import Logging+import XCTVapor++fileprivate extension RedisID {+ static let one: RedisID = "one"+ static let two: RedisID = "two"+}++class MultipleRedisTests: XCTestCase {++ var redisConfig: RedisConfiguration!+ var redisConfig2: RedisConfiguration!++ override func setUpWithError() throws {+ try super.setUpWithError()++ redisConfig = try RedisConfiguration(hostname: Environment.get("REDIS_HOSTNAME") ?? "localhost",+ port: Environment.get("REDIS_PORT")?.int ?? 6379)+ redisConfig2 = try RedisConfiguration(hostname: Environment.get("REDIS_HOSTNAME_2") ?? "localhost",+ port: Environment.get("REDIS_PORT_2")?.int ?? 6380)+ }++ func testApplicationRedis() throws {+ let app = Application()+ defer { app.shutdown() }++ app.redis(.one).configuration = redisConfig+ app.redis(.two).configuration = redisConfig2++ try app.boot()++ let info1 = try app.redis(.one).send(command: "INFO").wait()+ XCTAssertContains(info1.string, "redis_version")++ let info2 = try app.redis(.two).send(command: "INFO").wait()+ XCTAssertContains(info2.string, "redis_version")+ }++ ++ func testSetAndGet() throws {+ let app = Application()+ defer { app.shutdown() }++ app.redis(.one).configuration = redisConfig+ app.redis(.two).configuration = redisConfig2++ app.get("test1") { req in+ req.redis(.one).get("name").map {+ $0.description+ }+ }+ app.get("test2") { req in+ req.redis(.two).get("name").map {+ $0.description+ }+ }++ try app.boot()++ try app.redis(.one).set("name", to: "redis1").wait()+ try app.redis(.two).set("name", to: "redis2").wait()++ try app.test(.GET, "test1") { res in+ XCTAssertContains(res.body.string, "redis1")+ }++ try app.test(.GET, "test2") { res in+ XCTAssertContains(res.body.string, "redis2")+ }++
newline
comment created time in 10 hours
Pull request review commentvapor/redis
Support for Multiple Redis instances
+import Vapor++extension Application.Redis {+ /// The Redis configuration to use to communicate with a Redis instance.+ ///+ /// See `Application.Redis.id`+ public var configuration: RedisConfiguration? {+ get {+ self.application.redisStorage.configuration(for: self.id)+ }+ nonmutating set {+ guard let newConfig = newValue else {+ fatalError("editing pools after application has booted is not supported")
is this message correct? It seems to be copied from RedisStorage.swift
comment created time in 10 hours
Pull request review commentvapor/redis
Support for Multiple Redis instances
+import Vapor++extension Application {+ private struct RedisStorageKey: StorageKey {+ typealias Value = RedisStorage+ }+ var redisStorage: RedisStorage {+ if self.storage[RedisStorageKey.self] == nil {+ let redisStorage = RedisStorage()+ self.storage[RedisStorageKey.self] = redisStorage+ self.lifecycle.use(RedisStorage.Lifecycle(redisStorage: redisStorage))+ }+ return self.storage[RedisStorageKey.self]!+ }+}++class RedisStorage {+ private var lock: Lock+ private var configurations: [RedisID: RedisConfiguration]+ fileprivate var pools: [PoolKey: RedisConnectionPool] {+ willSet {+ guard pools.isEmpty else {+ fatalError("editing pools after application has booted is not supported")+ }+ }+ }++ init() {+ self.configurations = [:]+ self.pools = [:]+ self.lock = .init()+ }++ func use(_ redisConfiguration: RedisConfiguration, as id: RedisID = .default) {+ self.configurations[id] = redisConfiguration+ }++ func configuration(for id: RedisID = .default) -> RedisConfiguration? {+ self.configurations[id]+ }++ func ids() -> Set<RedisID> {+ Set(self.configurations.keys)+ }++ func pool(for eventLoop: EventLoop, id redisID: RedisID) -> RedisConnectionPool {+ let key = PoolKey(eventLoopKey: eventLoop.key, redisID: redisID)+ guard let pool = pools[key] else {+ fatalError("No redis found for id \(redisID), or the app may not have finished booting. Also, the eventLoop must be from Application's EventLoopGroup.")+ }+ return pool+ }++
redundant newlines
comment created time in 10 hours
Pull request review commentvapor/redis
Support for Multiple Redis instances
import Vapor import Logging import XCTVapor +extension String {+ var int: Int? { Int(self) }+}+ class RedisTests: XCTestCase {+ var redisConfig: RedisConfiguration!++ override func setUpWithError() throws {+ try super.setUpWithError()+ redisConfig = try RedisConfiguration(hostname: Environment.get("REDIS_HOSTNAME") ?? "localhost",+ port: Environment.get("REDIS_PORT")?.int ?? 6379)
redisConfig = try RedisConfiguration(
hostname: Environment.get("REDIS_HOSTNAME") ?? "localhost",
port: Environment.get("REDIS_PORT")?.int ?? 6379
)
comment created time in 10 hours