Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
camsaul committed Sep 10, 2019
0 parents commit 102c5e8
Show file tree
Hide file tree
Showing 44 changed files with 5,014 additions and 0 deletions.
179 changes: 179 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
version: 2.1

########################################################################################################################
# EXECUTORS #
########################################################################################################################

executors:
default:
working_directory: /home/circleci/camsaul/methodical/
docker:
- image: circleci/clojure:lein-2.9.1

java-11:
working_directory: /home/circleci/camsaul/methodical/
docker:
- image: circleci/clojure:openjdk-11-lein-2.9.1


########################################################################################################################
# COMMANDS #
########################################################################################################################

commands:

attach-workspace:
steps:
- attach_workspace:
at: /home/circleci/

restore-deps-cache:
steps:
- restore_cache:
keys:
- deps-{{ checksum "project.clj" }}
- deps-

jobs:

checkout:
executor: default
steps:
- restore_cache:
keys:
- source-{{ .Branch }}-{{ .Revision }}
- source-{{ .Branch }}
- source-
- checkout
- save_cache:
key: source-{{ .Branch }}-{{ .Revision }}
paths:
- .git
- persist_to_workspace:
root: /home/circleci/
paths:
- camsaul/methodical

lein:
parameters:
e:
type: executor
default: default
lein-command:
type: string
after-steps:
type: steps
default: []
executor: << parameters.e >>
steps:
- attach-workspace
- restore-deps-cache
- run:
command: lein << parameters.lein-command >>
no_output_timeout: 5m
- steps: << parameters.after-steps >>

reflection-warnings:
executor: default
steps:
- attach-workspace
- restore-deps-cache
- run:
command: ./check-for-reflection-warnings.sh
no_output_timeout: 3m


########################################################################################################################
# WORKFLOWS #
########################################################################################################################

workflows:
version: 2
build:
jobs:
- checkout

- lein:
name: deps
requires:
- checkout
lein-command: all-deps
after-steps:
- save_cache:
key: deps-{{ checksum "project.clj" }}
paths:
- /home/circleci/.m2

- lein:
name: tests
requires:
- deps
lein-command: test

- lein:
name: tests-java-11
requires:
- deps
e: java-11
lein-command: test

- lein:
name: eastwood
requires:
- deps
lein-command: eastwood

- lein:
name: docstring-checker
requires:
- deps
lein-command: docstring-checker

- lein:
name: namespace-decls
requires:
- deps
lein-command: check-namespace-decls

- lein:
name: bikeshed
requires:
- deps
lein-command: bikeshed

# Kibit disabled for now because namespace docstrings break it
# - lein:
# name: kibit
# requires:
# - deps
# lein-command: kibit

- lein:
name: cloverage
requires:
- deps
lein-command: cloverage --codecov
after-steps:
- run:
command: bash <(curl -s https://codecov.io/bash)

- reflection-warnings:
requires:
- deps

- lein:
name: deploy
requires:
- bikeshed
- docstring-checker
- eastwood
- namespace-decls
# - kibit
- cloverage
- reflection-warnings
- tests
- tests-java-11
lein-command: deploy clojars
filters:
branches:
only: master
14 changes: 14 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
((nil . ((indent-tabs-mode . nil) ; always use spaces for tabs
(require-final-newline . t))) ; add final newline on save
(clojure-mode . (;; if you're using clj-refactor (highly recommended!), prefer prefix notation when cleaning the ns form
(cljr-favor-prefix-notation . t)
;; prefer keeping source width about ~118, GitHub seems to cut off stuff at either 119 or 120 and
;; it's nicer to look at code in GH when you don't have to scroll back and forth
(fill-column . 118)
(clojure-docstring-fill-column . 118)
(eval . (define-clojure-indent
(p.types/defprotocol+ '(1 (:defn)))
(p.types/definterface+ '(1 (:defn)))
(p.types/def-abstract-type '(1 (:defn)))
(p.types/deftype+ '(2 nil nil (:defn)))
(p.types/defrecord+ '(2 nil nil (:defn))))))))
10 changes: 10 additions & 0 deletions .eastwood-config.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(disable-warning
{:linter :unused-ret-vals
:if-inside-macroexpansion-of #{'clojure.core/doseq}
:within-depth 50
:reason "doseq is done for side-effects. Of course the return values will be unused." })

#_(disable-warning
{:linter :unused-fn-args
:if-inside-macroexpansion-of #{'methodical.core/defmethod}
:within-depth 10})
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
*.class
*.jar
.\#*
/*.iml
/.eastwood
/.env
/.envrc
/.idea
/.lein-deps-sum
/.lein-env
/.lein-failures
/.lein-plugins
/.lein-repl-history
/.nrepl-port
/build.xml
/checkouts
/classes
/classes
/config.edn
/lib
/pom.xml
/pom.xml.asc
/profiles.clj
/tags
/target
\#*\#
Loading

0 comments on commit 102c5e8

Please sign in to comment.