Skip to content

Commit c44b090

Browse files
committed
added main files for the project
1 parent fbf70ad commit c44b090

File tree

7 files changed

+1214
-26
lines changed

7 files changed

+1214
-26
lines changed

LICENSE

+674-21
Large diffs are not rendered by default.

README.md

+163-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# ExMacroInspect
22

3-
**TODO: Add description**
3+
`ExMacroInspect` is a macro inspection library for elixir. I makes it easy for a developer to see what is passed into a macro during macro development.
4+
5+
# Source:
6+
* https://github.com/smorin/ExMacroInspect
7+
8+
# Documentation:
9+
* https://hexdocs.pm/ex_macro_inspect/
410

511
## Installation
612

@@ -15,7 +21,163 @@ def deps do
1521
end
1622
```
1723

24+
## Core Checklist
25+
* [x] setup README.md - create README
26+
* [x] setup LICENSE file - create LICENSE pick Apache
27+
* [x] automated build - makefile automated help
28+
* [x] build configuration - elixir mix.exs setup
29+
* [x] code formatter - elixir formatter and configuration setup
30+
* [x] style check - elixir credo
31+
* [x] static analysis - elixir dialyzer
32+
* [x] project documentation - elixir ex_doc setup with makefile
33+
* [x] code coverage - elixir code coverage with excoveralls
34+
* [x] publish the package - publish to hex
35+
36+
## Optional Checklist
37+
* [x] deployment package - erlang release with distillery
38+
* [x] phx configuration 4 package - config.exs setup with aliases
39+
* [x] distillery config - update config/prod.exs with "config :phoenix, :serve_endpoints, true"
40+
* [ ] logging - elixir logging
41+
* [x] benchmarking setup - elixir benchee setup
42+
* [x] load testing setup - elixir wrk
43+
44+
## setup README checklist
45+
* [ ] create README
46+
* [ ] add project description
47+
* [ ] add main project source reference: github_url_to_self
48+
* [ ] add contributors section
49+
50+
## setup LICENSE checklist
51+
* [ ] select licence from: https://choosealicense.com/
52+
* [ ] create LICENSE file
53+
* [ ] update template with things like name, description and copyright as necessary
54+
55+
## automated build checklist
56+
* [ ] copy makefile from https://github.com/smorin/ExMacroInspect
57+
* [ ] update in the makefile variable `app-name := ex_macro_inspect` to be the value of `mix.exs:def project[app:]`
58+
* [ ] test makefile see below
59+
60+
## build configuration checklist
61+
* [ ] update `def project do` with `aliases: aliases()`,
62+
* [ ] create `defp aliases` see below
63+
* [ ] update `def project do` with `default_task: "help_make"`,
64+
```
65+
defp aliases do
66+
[
67+
help_make: "cmd make"
68+
]
69+
end
70+
```
71+
* [ ] test alias `mix` you should see make commands
72+
73+
## code formatter checklist
74+
* [ ] create `.formatter.exs`
75+
```
76+
[
77+
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"]
78+
]
79+
```
80+
* [ ] test `make format`
81+
82+
## style check checklist
83+
* [ ] add to deps `{:credo, "~> 0.9.1", only: [:dev, :test], runtime: false}`
84+
* [ ] test `make style-checks`
85+
86+
## static analysis checklist
87+
* [ ] add to deps `{:dialyxir, "~> 1.0.0-rc.2", only: [:dev], runtime: false}`
88+
* [ ] test `make static-analysis`
89+
90+
## Test makefile build
91+
* [ ] check after setting up `code formatter`, `style check` and `static analysis` with `make setup build`
92+
93+
## project documentation checklist
94+
* [ ] add to deps `{:ex_doc, "~> 0.16", only: :dev, runtime: false}`
95+
* [ ] update `def project do` with
96+
* [ ] name: "project_name",
97+
* [ ] source_url: "https://github.com/USER/PROJECT",
98+
* [ ] homepage_url: "http://YOUR_PROJECT_HOMEPAGE",
99+
* [ ] description: """ ADD YOUR DESCRIPTION """
100+
* [ ] add to `def project do [ docs: docs(),]` and `defp docs` see below
101+
* [ ] Reference configs here: https://hexdocs.pm/ex_doc/Mix.Tasks.Docs.html#content
102+
* [ ] add to `defp docs`
103+
* [ ] main: "ModuleName_or_Page" - Main page of the documentation. It may be a module or a generated page
104+
* [ ] logo: "path/to/file.png_or_jpg"
105+
* [ ] extras: `"README.md": [filename: "readme", title: "README"]]`
106+
* [ ] extra_section: "Name of Extra Section in docs"
107+
* [ ] optionally add groups_for_extras: `[ Introduction: Path.wildcard("guides/introduction/*.md") ]`
108+
* [ ] optionally add groups_for_modules: `[ Controllers: [ Module.Name ] ]`
109+
* [ ] optionally add assets: "path/to/dir"
110+
* [ ] test documentation `make docs open-docs`
111+
```
112+
### --
113+
# all configuration required by ex_doc to configure the generation of documents
114+
### --
115+
defp docs do
116+
[
117+
main: "ModuleName_or_Page",
118+
logo: "guides/assets/image.png_or_jpg",
119+
extras: ["README.md": [filename: "readme", title: "README"]],
120+
extra_section: "GUIDES",
121+
groups_for_extras: [
122+
Introduction: Path.wildcard("guides/introduction/*.md")
123+
],
124+
# Ungrouped Modules:
125+
#
126+
# OtherModules
127+
groups_for_modules: [
128+
Controllers: [
129+
Module.Name
130+
]
131+
]
132+
]
133+
end
134+
```
135+
136+
## code coverage checklist
137+
* [ ] add to deps `{:excoveralls, "~> 0.8", only: [:dev, :test]}`
138+
* [ ] update `def project do` with `test_coverage: [tool: ExCoveralls]`,
139+
* [ ] test `make coverage-report`
140+
141+
## publish the package
142+
- [ ] Install hex `mix local.hex`
143+
- [ ] Register hex user run: `mix hex.user register`
144+
- [ ] Confirm your account via email
145+
- [ ] update `def project do` with `package: package()`, see below
146+
- [ ] mix.exs add fill out `defp package` keys
147+
- [ ] check no git dependencies
148+
- [ ] run: `mix hex.publish`
149+
- [ ] if first publish update references to hexdocs in readme and mix.exs
150+
151+
```
152+
defp package() do
153+
[
154+
# This option is only needed when you don't want to use the OTP application name
155+
name: "package_name",
156+
organization: "hexpm",
157+
# These are the default files included in the package
158+
files: ["lib", "priv", "mix.exs", "README*", "readme*", "LICENSE*", "license*"],
159+
licenses: ["GNU 3.0"],
160+
links: %{"GitHub" => "https://github.com/USERNAME/PROJECTNAME", "HexDocs" => "https://hexdocs.pm/PACKAGE/"}
161+
]
162+
end
163+
```
164+
18165
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
19166
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
20167
be found at [https://hexdocs.pm/ex_macro_inspect](https://hexdocs.pm/ex_macro_inspect).
21168

169+
## Core References
170+
* https://github.com/parroty/excoveralls
171+
* https://github.com/jeremyjh/dialyxir
172+
* https://github.com/rrrene/credo
173+
* https://github.com/bitwalker/distillery
174+
* https://github.com/elixir-lang/ex_doc
175+
176+
## Optional Refrences
177+
* https://github.com/wg/wrk
178+
* https://github.com/elixir-lang/elixir/tree/master/lib/logger
179+
* https://github.com/PragTob/benchee
180+
181+
182+
## Contributors
183+
* Steve Morin - https://github.com/smorin

guides/assets/elixir.png

69.8 KB
Loading

lib/ex_macro_inspect.ex

+19-2
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,32 @@ defmodule ExMacroInspect do
55
"""
66

77
@doc """
8-
mray should be called
8+
mray prints that the mray macro with no arguments was called
99
"""
10-
defmacro mray() do
10+
defmacro mray do
1111
IO.puts("mray/0 called")
1212
nil
1313
end
1414

15+
@doc """
16+
mray prints the 1 AST argument to the mray macro
17+
"""
1518
defmacro mray(first_arg) do
1619
IO.puts("mray/1 called.\nfirst_arg:#{first_arg}")
1720
nil
1821
end
1922

23+
@doc """
24+
mray prints the 2 AST arguments to the mray macro
25+
"""
2026
defmacro mray(first_arg, second_arg) do
2127
IO.puts("mray/2 called.\nfirst_arg:#{inspect(first_arg)}\nsecond_arg:#{inspect(second_arg)}")
2228
nil
2329
end
2430

31+
@doc """
32+
mray prints the 3 AST arguments to the mray macro
33+
"""
2534
defmacro mray(first_arg, second_arg, third_arg) do
2635
IO.puts(
2736
"mray/2 called.\nfirst_arg:#{inspect(first_arg)}\nsecond_arg:#{inspect(second_arg)}\nthirst_arg#{
@@ -31,4 +40,12 @@ defmodule ExMacroInspect do
3140

3241
nil
3342
end
43+
44+
@doc """
45+
Is just there to show a method for tests
46+
"""
47+
@spec hello() :: atom()
48+
def hello do
49+
:world
50+
end
3451
end

0 commit comments

Comments
 (0)