Commit Graph
177 Commits
Author SHA1 Message Date
Louis Pilfold 0230128ee8 Correct small inaccuracy in EEx.Engine moduledoc (#5187)
Pesky off by 1 errors.
2016-09-06 21:50:47 +02:00
Eksperimental 2e97c1e15e Name variables in callbacks (#4880) 2016-06-25 04:08:43 +02:00
Aleksei Magusev b86b8ca335 Emit warning when variable is being expanded to function call (#3517) 2016-06-11 22:31:03 +02:00
eksperimental e59a9f82fd Use proper case for proper nouns and acronyms
Use proper case for proper nouns (e.g., Elixir, Rebar, Git, and others)
as well as acronyms (e.g., URL, HTTP, and others).
2016-06-06 15:17:59 +02:00
José Valim c14a05f73d Update TODOs and CHANGELOG
* Functionality won't be removed before v2.0
  * Features soft-deprecated in Elixir v1.2 will warn on v1.4
  * Features soft-deprecated in Elixir v1.3 will warn on v1.5
2016-06-02 21:21:24 +02:00
José Valim 99215be444 Update CHANGELOG 2016-05-29 12:31:12 +02:00
José Valim d050b41452 Fix warning errors in IEx and EEx 2016-05-15 21:00:20 +02:00
Louis Pilfold 7ab8f10a89 IO.warn to unify warnings (#4615)
* IO.warn/1 function

* Use IO.warn/1 instead of IO.write :stderr

* Add stack trace printing to IO.warn

* Remove manual stacktrace concatting from IO.warn calls

* Remove double trailing newline from IO.warn
2016-05-13 14:12:01 +02:00
eksperimental c3d28f76f2 Replace 'char_list' and 'char list' with 'charlist' 2016-05-07 03:20:57 +07:00
eksperimental bc8c2a55e9 Standardize unicode and friends (#4569)
* Unicode is a proper noun, so it should be capitalized

* Replace 'char data' with 'chardata'

* Correct use of a/an articles
2016-05-05 09:21:05 +02:00
eksperimental 685e87bdf0 Formmating: Add white space around vertical bar (#4507) 2016-04-25 00:55:49 +02:00
eksperimental ba111fb9b3 Formatting: add white space after comma (#4491)
Standardizes the use of comma leaving a white space after it whenever applicable.

Note: It does not enforce this in quantifiers in regular expressions such as in: `x{1,3}`
2016-04-19 01:23:50 +02:00
eksperimental d4a9ae89e8 Few improvements to EEx docs (#4494) 2016-04-08 09:55:15 +02:00
Brandon Fish eea608c209 Add test coverage to EEx 2016-04-03 08:43:22 -05:00
Andrea Leopardi 9d6ac4d2af Add final newlines to a bunch of files
A bunch of files didn't end with a final newline (according to the POSIX
standard -
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206).
2016-03-29 23:02:22 +02:00
eksperimental 3706ba7845 Add arity to functions in docs 2016-02-09 07:14:25 +07:00
Aleksei Magusev b2372d2436 Inspect path in File.Error exception message 2016-01-24 23:18:00 +01:00
José Valim dc5515e790 Define @callback init for EEx.Engine 2016-01-21 23:43:23 +01:00
José Valim b3c7bc0a1f Include init/1 in EEx engines 2016-01-21 22:33:58 +01:00
José Valim 6ed8b6235b Document 1.2 options and avoid 1.2 warnings 2016-01-21 21:40:45 +01:00
José Valim fe14caeacc Deprecate soft-deprecated functionality 2016-01-02 11:04:21 +01:00
José Valim 51180f5630 Properly change __ENV__.file when @file is set
Note that @file may be set from the :file meta as well.
2015-11-21 05:02:38 +08:00
José Valim cfc4bc20d1 Remove uses of soon to be deprecated Dict 2015-10-23 15:04:24 +02:00
José Valim ef1aff41e6 Move eex error to warning 2015-10-23 13:28:42 +02:00
José Valim ab9ead7d0f Merge pull request #3349 from tony612/eex-raises-on-missing-assigns
eex engine raises on missing assigns
2015-10-23 13:23:05 +02:00
eksperimental ce7f57482d Remove trailing semicolong from summaries 2015-09-26 17:36:11 +07:00
eksperimental a1507d9393 Standardize use of backticks and quotes; including Error messages and Title Case commands
This is a large commit that does the following:
* Removes backticks from messages and comments.
  All references to backticks have been replaced with double quotes everywhere the
  code is not interpreted as Markdown, (ie. anywhere outside documentation and
  markdown files, such as in code comments, or error messages).

* Variables in Exception messages are printed using `inspect`
  The way no-matching error message are printed, have changed because now we use inspect for printing
  variables. The following file and their respective test have been changed:
  - lib/elixir/lib/exception.ex
  - lib/elixir/lib/inspect/algebra.ex
  - lib/elixir/test/elixir/inspect_test.exs
  - lib/ex_unit/test/ex_unit/formatter_test.exs
  - lib/elixir/test/elixir/exception_test.exs

* Properly use Title Case for Mix, Git, Dializer

* Use backticks when citing a command

****************************************************
CONVENTION FOR RENAMING USING BACKTICKS AND QUOTES

https://github.com/elixir-lang/elixir/pull/3697#issuecomment-138811747

1. Backticks should never be printed in error messages, neither be included anywhere where Markdown code is not interpreted as such.

2. Do not use single quotes anywhere. We should favor double quotes everywhere, to avoid confusion

3. If you want to format something in error messages, use inspect. For example, if you want to show the dependency name and that is an atom, instead of the dependency "foo", let's show the dependency :foo. Less noise and may click better

4. Similarly, if you want to show something with double quotes, call inspect, as it handles escaping as well as the quotes

5. Things like "--all" just add verbosity, we can definitely read --all without ambiguity.

6. When using switches with a single hyphen (such as "-o"), we can make it explicit in the text: e.g. "... give the switch -o when choosing ..."

****************************************************
SHELL COMMANDS TO DETECT CODE BREAKING THE RULES

* Detect values surrounded by single-quotes where we want double-quotes.

    # regular variables
    ag "'#{"
    # constants or ENV variables
    ag "'[A-Z][A-Z0-9_-]+"
    # switches
    ag -i "(?<!(\[))'--?[a-z0-9][a-z0-9_-]+'"
    # atoms
    ag -i "(?<!(\[))':[a-z0-9][a-z0-9_-]+'"

    # DETECT BACKTICKS OUTSIDE DOCS
    ag "^\s+(?<!(#))#[^#\r\n]*\`" --ignore "*.md"
    ag '^\s+["%].*`' --ignore "*.md"
    ag -s '(raise|Error)\b(?!(`|/)).*\`'

* Spot mentions to running a command that is not using backticks:

    commands="elixir|elixirc|mix|iex|ex_doc|git|make|rebar|dialyzer|erl|rm|cd|mkdir|rmdir|ln|ls|pwd"
    actions="runs?|running|executes?|executing|types?|typing|enters?|entering|calls?|calling"
    ag '(?i)('${actions}')(?-i)\b[^`\r\n/]+[\ \t]+(?!(`))('${commands}')'
    ag '(?-i)\b(?!(`))('${commands}')[\ \t]+[^`\r\n/]+(?i)(commands?)'

* Spot where a command is mentioned:

    #commands="erlang|elixir|eex|iex|ex_unit|ex_doc|logger|elixirc|git|make|rebar|dialyzer|erl|rm|cd|mkdir|rmdir|ln|ls|pwd"
    commands="mix|elixirc|git|make|rebar|dialyzer|erl|rm|cd|mkdir|rmdir|ln|ls|pwd"
    ag -s '(?<!(\`))(?<!(\.))(?<!(/))(?<!(:))(?<!(_))\b('${commands}')\b(?!(:))(?!(\?))(?!(_))(?!(-))(?!(\.))(?!(\`))(?!(/))(?!(>))' \
    --ignore "*.erl" --ignore "*.yrl" --ignore "*.src"
2015-09-11 18:49:51 +07:00
eksperimental d38db94f00 Avoid splitting words that use hyphen
For the ones in the documentation, a space will be added in after the hyphen.
Just for consistency and to ease detection, I have replaced the ones in
comments as well.

Command to detect these lines:

    ag "\w+-\n"
2015-09-07 21:22:25 +07:00
eksperimental 25075e3ea8 Correct descriptions in @doc, @moduledoc, @shortdoc to use Present Continuous
It makes it consistent with the rest of the docs.

I have just looked for the first line in @doc, @moduledoc, so lines bellow it may still need
to be corrected.

@shortdoc all have been corrected.

Inspired by: https://github.com/elixir-lang/elixir/pull/2942

Command to list the first lines:

```sh
  # first line in @moduledoc / @doc
  ag '(@(module)?doc)\s+("{3})(\r|\n|.)\s*+[\w-]+(?<!s)\b'

  # also @shortdoc
  ag '(@shortdoc)\s+("{1,3})(\r|\n|.)\s*+[\w-]+(?<!s)\b'
```
2015-09-07 18:40:58 +07:00
José Valim 8efe906456 Remove usage of use Behaviour 2015-08-14 23:02:20 +02:00
Tony Han 83ec278f7e eex engine raises on missing assigns 2015-06-11 10:30:36 +08:00
José Valim da9029a04f Ensure blocks do not clobber eex buffer 2015-05-11 23:07:26 +02:00
Louis Pilfold 410748b1b2 Revert 9477565 now underlying issue has been resolved.
The old formatting is much nicer. :)

This reverts commit 9477565a45.
2015-05-01 09:02:06 +01:00
Louis Pilfold 9477565a45 EEx doc: Prevent list from being rendered as code blocks 2015-04-30 17:26:53 +01:00
Or Neeman 67795d41e9 EEx: allow ) after end in end tokens
Closes #3017
2015-04-10 20:49:06 -06:00
Or Neeman 50c59187af EEx: correct doc for handle_assign/1 2015-04-10 11:14:54 -06:00
eksperimental 0f60b9f9ca remove repeated word 2015-04-07 06:47:25 +07:00
José Valim 0ed1ea4d40 Only make tokenizer return char lists 2015-03-27 09:54:20 -07:00
José Valim c0054f53d5 Merge pull request #3194 from oneeman/eex-trim
EEx: Add trim option
2015-03-27 08:26:13 -07:00
Or Neeman b2b48d5489 Refactor trim mode 2015-03-25 19:31:01 -06:00
eksperimental 06eeddcb6d correct @spec for handle_expr 2015-03-25 23:53:44 +07:00
eksperimental d1a0218902 Explicitely declare argument names for functions with unnamed arguments. 2015-03-25 16:26:07 +07:00
Or Neeman 29f1375f1f EEx: Add trim option
If the `trim` option is used, trims around EEx tags:
- On left, up to the line break if all whitespace
- On right, up to and including the line break if all whitespace

Does not trim around quotations (`<%% %>`), but does trim around
any tags inside a quotation.

Closes #3154
2015-03-23 19:26:18 -06:00
Or Neeman 9d3ebd9f84 EEx: convert tag type markers to char lists 2015-03-22 13:36:54 -06:00
Or Neeman 18c271eb4b EEx: fix interpolation inside quotations
Closes #3159
2015-03-22 09:00:34 -06:00
Or Neeman a958fa6681 Fix error in EEx docstring ("a macro" to "an expression") 2015-03-21 14:26:24 -06:00
Alexander Ivanov d7e00557d0 Add column info in tokenizer, #2987
Add column info for each token in elixir_tokenizer.
Change the format of location info from `Line` to `[Line, BeginColumn,
EndColumn]`. Pass the current column after the current line in
`elixir_tokenizer:tokenize`. Reflect the change in related modules.
2015-01-05 03:34:53 +02:00
Doug Yun c755789df2 smart_engine: Rephrases doc 2014-12-19 01:07:54 -05:00
José Valim d4bc57e984 Unify error reporting from EEx, closes #2833 2014-10-21 11:25:20 -02:00
Shayan Pooya 3ab6443790 fix typos 2014-10-16 12:50:12 -05:00