Upgrade to Pro — share decks privately, control downloads, hide ads and more …

On guard of surce code

On guard of surce code

Paul Taykalo

April 06, 2019
Tweet

More Decks by Paul Taykalo

Other Decks in Programming

Transcript

  1. On guard of the Source Code 1 — On guard

    of the Source Code, by Paul Taykalo, MacPaw
  2. When just writing a code is not enough 2 —

    On guard of the Source Code, by Paul Taykalo, MacPaw
  3. Sometimes we don't care about the code 3 — On

    guard of the Source Code, by Paul Taykalo, MacPaw
  4. Sometimes we do care about the code 4 — On

    guard of the Source Code, by Paul Taykalo, MacPaw
  5. No code - no problems 5 — On guard of

    the Source Code, by Paul Taykalo, MacPaw
  6. Problems with code 6 — On guard of the Source

    Code, by Paul Taykalo, MacPaw
  7. A lot of source - not a problem → Code

    style → Documentation → Refactoring → Code generation → Code Analysis 7 — On guard of the Source Code, by Paul Taykalo, MacPaw
  8. Code Style Linters and formatters → swiftlint → swiftformat →

    swift-format → tailor, taylor* 9 — On guard of the Source Code, by Paul Taykalo, MacPaw
  9. Code generation → Sourcery → Swagger → Generamba → R

    → SwiftGen 14 — On guard of the Source Code, by Paul Taykalo, MacPaw
  10. Code Analysis → Static Analyzer in Xcode → Swiftlint O_o

    (experimental feature) 16 — On guard of the Source Code, by Paul Taykalo, MacPaw
  11. Source Obvious, we'll work with Swift and ObjC 20 —

    On guard of the Source Code, by Paul Taykalo, MacPaw
  12. Destination → Docs → More code! → Code Checks →

    Images 22 — On guard of the Source Code, by Paul Taykalo, MacPaw
  13. Rules disabled_rules: # rule identifiers to exclude from running -

    colon - comma - control_statement opt_in_rules: # some rules are only opt-in - empty_count # Find all the available rules by running: # swiftlint rules included: # paths to include during linting. `--path` is ignored if present. - Source excluded: # paths to ignore during linting. Takes precedence over `included`. - Carthage - Pods - Source/ExcludedFolder - Source/ExcludedFile.swift - Source/*/ExcludedFile.swift # Exclude files with a wildcard 24 — On guard of the Source Code, by Paul Taykalo, MacPaw
  14. Tools for processing Code 25 — On guard of the

    Source Code, by Paul Taykalo, MacPaw
  15. Tools for processing Code Regex-based solutions → IR: Strings →

    Somewhat unreliable 26 — On guard of the Source Code, by Paul Taykalo, MacPaw
  16. Tools for processing Code Custom Parser Solutions → IR: (DSL)

    → Trying to parse code on its own → Using own AST 27 — On guard of the Source Code, by Paul Taykalo, MacPaw
  17. Tools for processing Code Sourcekit based solutions → IR: AST,

    Binary, JSON* → Using Sourcekit library → Always up to date 28 — On guard of the Source Code, by Paul Taykalo, MacPaw
  18. SourceKit is ... 30 — On guard of the Source

    Code, by Paul Taykalo, MacPaw
  19. SourceKit is ... 31 — On guard of the Source

    Code, by Paul Taykalo, MacPaw
  20. SourceKit is... Welcome to SourceKit! SourceKit is a framework for

    supporting IDE features like indexing, syntax- coloring, code-completion, etc. In general it provides the infrastructure that an IDE needs for excellent language support. SourceKit currently only supports the Swift language. 33 — On guard of the Source Code, by Paul Taykalo, MacPaw
  21. SourceKit → Code Completion → Cursor Info → Demangling/Demangling →

    Documentation → Module interface generation → Indexing* 34 — On guard of the Source Code, by Paul Taykalo, MacPaw
  22. SourceKit options → C Interface → sourcekitd.framework → libsourcekitdInProc.dylib →

    Official Python Binding → Unofficial Swift Binding: SourceKitten 35 — On guard of the Source Code, by Paul Taykalo, MacPaw
  23. SourceKitten → ✅ Command Line Util → ✅ Framework →

    ✅ Wrapper over SourceKit → ✅ Writtent in Swift 37 — On guard of the Source Code, by Paul Taykalo, MacPaw
  24. Tools with Sourcekitten → ✅ SwiftLint: Swift style and conventions.

    → ✅ Jazzy: Docs for Swift & Objective-C. → ✅ Sourcery: Meta-programming for Swift → ✅ Cuckoo: Mocking framework for Swift. 38 — On guard of the Source Code, by Paul Taykalo, MacPaw
  25. Tools with Sourcekitten → ✅ SwiftyMocky: Framework for mock genertion.

    → ✅ SourceKittenDaemon: Auto Completions . → ✅ SourceDocs: Markdown documentation. → ✅ Taylor: Measure Swift code metrics 39 — On guard of the Source Code, by Paul Taykalo, MacPaw
  26. SourceKitten uses SwiftLint, which is based on SourceKitten 40 —

    On guard of the Source Code, by Paul Taykalo, MacPaw
  27. libsyntax - C library SwithSyntax - Swift wrapper library 42

    — On guard of the Source Code, by Paul Taykalo, MacPaw
  28. Q & A 50 — On guard of the Source

    Code, by Paul Taykalo, MacPaw
  29. On guard of the Source Code by Paul Taykalo, MacPaw

    @TT_Kilew 51 — On guard of the Source Code, by Paul Taykalo, MacPaw