When I submitted the HLSL-language, I accidentally missed that the
first extension was the primary one (as is documented in the source
code, which I unfortunately missed), and instead alphabetized the
whole list.
The primary extension should be .hlsl, so let's remedy this.
BUCK is the filename for the build files of the Facebook Buck build
system. BUCK files are valid Python files.
Eg.:
https://github.com/GerritCodeReview/gerrit/blob/master/BUCK
Also add a missing sample for Pants / Bazel BUILD files. They are also
valid Python files.
Add support for DirectX HLSL / FX files. The FX files are
just HLSL files with some additional syntax to set
render-states and define multiple shader stages in one file.
Samples are either written by me, or taken from Chromium.
These samples were taken from the paper "Flux: A Language for
Programming High-Performance Servers", by Burns et al and Flux V0.02
which can be found here:
https://plasma.cs.umass.edu/emery/flux.1.html
GrammarKit is a plugin by JetBrains for creating custom language plugins
for JetBrains IDEs (such as IntelliJ, RubyMine, CLion and more). It
defines a BNF parser language which can be used to generate a parser in
Java, and it also integrates JFLex for generating a lexer in Java.
Both of these generated Java files can be recognised by a comment on the
first line of the file, and so classifying them as generated is trivial.
TLDR: This greatly increases the flexibility of vim modeline detection
to manually set the language of a file.
In vim there are two forms of modelines:
[text]{white}{vi:|vim:|ex:}[white]{options}
examples: 'vim: syntax=perl', 'ex: filetype=ruby'
-and-
[text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
examples: 'vim set syntax=perl:', 'Vim: se ft=ruby:'
As you can see, there are many combinations. These changes should allow
most combinations to be used. The two most important additions are the
use of the keyword 'syntax', as well as the addition of the first form
(you now no longer need to use the keyword 'set' with a colon at the end).
The use of first form with 'syntax' is very, very common across GitHub:
https://github.com/search?l=ruby&q=vim%3A+syntax%3D&ref=searchresults&type=Code&utf8=%E2%9C%93
When using syntax extensions in stable or beta Rust channels using the syntex package, it is common to use the file extension .rs.in for the source file, and .rs for the generated file.
Updated grammar to support triple-quoted strings properly:
0c53f8162e
atom-language-purescript repo has been moved to purescript-contrib org,
update the URL.
There's no need for `clear_cache` to fail if the cache doesn't exist,
either because we call `clear_cache` twice or because no cache was
previously written on this particular repo.
Since Octave is a clone of Matlab, the syntax is exactly the same
and hence it is desirable for highlighting to be exactly the same
as well.
Adding octave as an alias for Matlab will trivially provide support
for highlighting Octave code, and will ensure the two languages
always use the same syntax highlighting rules.
Linguist currently uses the presence of "move" commands to differentiate
a GAS file from Groff. This is problematic with MAXScript, with includes
a built-in function of that name. Furthermore, because of the language's
exhaustive vocabulary, case insensitive nature and flexible syntax, it's
difficult to impose rigid criteria on classifying it.
This commit modifies the heuristic to assume the following flow:
1. If a line contains ".include" or ".global"/".globl" which doesn't
follow a non-whitespace character, assume GAS.
2. Otherwise, if the line starts with a command like ".LG7E0" with a
possible string of whitespace before it, assume it's also GAS.
UNLESS either of the following conditions are true:
2a. The token is enclosed by a string or /* multiline comment */
2b. The previous line ends with a backslash to denote a statement
broken between lines, with possible whitespace and/or comment
sequences between the backslash and the actual newline.
3. If neither of the above are met, assume the file is MAXScript.
This approach may appear overly-inclusive, but given real-world usage of
MAXScript includes writing brief files with few distinguishing keywords,
it's reasonable to permit this leniency.
Rake's tests are failing because #0AA is too similar to the colour being
used by another language (Dart: #00B4AB). This commit increases contrast
enough to satisfy the build (with 00A6A6 being the closest shade allowed
by the current colour threshold).
See also: github/linguist@3c96f9e
This is a test. I don't understand the details of how the `bundle config
build.charlock_holmes` bit works/fails, so the intent here is to get a PR posted
for purposes of getting feedback via the full Travis machinery.
plus a few minor language support updates including:
- recognize `sclang` and `scsynth` interpreters
- set `tm_scope: source.supercollider`
- reorder extensions so that `.sc` is primary
This adds the .cake file extension to the C# language.
Here is a search in the wild: https://github.com/search?q=extension%3Acake+NOT+coffee&type=Code
Cake (C# Make) is a cross platform build automation system with a C# DSL to do things like compiling code, copy files/folders, running unit tests, compress files and build NuGet packages.
You can find out out more about cake here: http://cakebuild.net/
The original yellow color doesn't fit D very well, and it looks an awful lot like the color for JavaScript. This changes it to the color used on the website's sidebar, and nice dark maroon: http://www.colorpicker.com/2e2324
This changeset includes a sample racc file from [this auto-generated
file](44e9bf0440/lib/rjson/parser.rb)
(MIT-licensed).
[Racc](https://github.com/tenderlove/racc) Racc is an LALR(1) parser
generator. It is written in Ruby itself, and generates ruby programs.
Taken from tokenrove/parsur so I don't have to worry about license
hassles. (You may relicense these samples as necessary.)
It would be nice to have an example of the embedded SQL syntax in a
sample.
I have used syntactic color values with respect to the table below:
A | B C | D | E | F G | H | I | J K | L M | N O | P Q | R S | T U | V W | X | Y Z
0 1 2 3 4 5 6 7 8 9 A B C D E F
For example for Gradle the color should be 4B0283, for Cuda the color should be 1C201C(for six-letter CudaCu) and for reStructuredText the color should be B3BCBC(for six-letter reStru).
* 'master' of https://github.com/github/linguist:
Switch to Apache License.
also add help for unapproved licenses
Update X10 grammar license.
add some help text to license test
Fix typo in Obj-C heuristic keyword
Add the X10 language (http://x10-lang.org/).
Sublime Text workspace files as vendored
Make Slick regexp more general
Tests for new vendored files
Test for new CodeMirror regexp
New JS vendored files
Fix CodeMirror regex for vendored files
added *.lslp to samples/LSL folder
added *.lslp as LSL(Linden Scripting Language)
Conflicts:
.gitmodules
RAML was originally merged as a data language, but this seems like an incorrect definition. I changed it to be markup instead, which will also result in RAML appearing in repo statistics.
This change allows the filetype/language to be retrieved from more complex vim modelines. The current regex strictly allows a set line which contains only the filetype/ft parameter and nothing else
Prior to this commit, some Puppet files were being incorrectly
identified as Pascal when they contained only the following content:
hiera_include('classes')
This commit adds a hiera_include() sample to for the Puppet language to
correct this behavior.
Prior to this commit, the Puppet language was colored to #332A77. The
Puppet Labs style guide (https://puppetlabs.com/styleguide/brand)
specifies Puppet Dark Purple to be #302B6D. Alternately, Puppet Purple,
a lighter variant, may be used: #7C6AAB.
Keeping with the dark purple theme, this commit modifies the Puppet
language to use Puppet Dark Purple, hex #302B6D.
Makes it possible to detect the language of a snippet of code
without having an actual file on disk
Will allow github-markup to use Linguist without restricting its API
The previous definition used at fsharpbinding is no longer maintained.
That repository has been split into separate parts for each editor. Atom
now has the most complete compatible grammar.
XPages design element extensions and NSF-based design elements (Form, View) extensions added (all readable when marked up using XML settings for ACE); .jss (Domino SSJS) already aliased under JavaScript
zend_ini_scanner.l by Zend Technologies; New BSD license.
common.l by Toshihiro MATSUI, Electrotechnical Laboratory; New BSD license.
create_view.l by PostgreSQL Global Development Group; MIT license.
the emacs modeline is actually a per-file variable setting mechanism, which means it can have other flags in it.
this regex extracts the part that corresponds to the file's language ("mode:" - ie emacs major mode)
http://ergoemacs.org/emacs_manual/emacs/Specifying-File-Variables.html
The assumption that `.conf` files are Apache is causing many projects to
be detected incorrectly as being primarily "ApacheConf".
The `.conf` extension is widely used by software; Apache accounts for
only a very tiny proportion of its overall use. The addition of `.conf`
for ApacheConf has resulted in projects which contain none (or almost
no) Apache config being marked as primarily containing it.
The problem was introduced by 18a3ef9e5e
Gettext catalogues are used for translations and are thus essentially prose, but were classified as "programming" in 507d191d7d.
In large projects like e.g. wesnoth/wesnoth, gettext can dominate the language statistics with about 95% although the actual code is C++.
Sample file mpq.d by Georg Lukas; license GPL 2.
Sample file counts.d by Kate Turner; public domain.
Sample file javascript-race.d by unknown; license MPL 1.1/GPL 2.0/LGPL 2.1.
Sample file probes.d by momjian; license TBD.
While XML is technically a markup language, in the majority of cases it
is just a serialization format for a tool (e.g., project files for IDEs)
rather than hand-authored markup. As such it isn't really useful to
include it in repository language statistics. A C# project doesn't
really care whether Visual Studio uses XML, JSON, or some other format
to serialize its project files, for example.
* vendor/grammars/Modelica f2b1242...e1fd853 (1):
> Some string improvements
* vendor/grammars/NimLime 58a1e0c...fac6b18 (2):
> Added support for ST3
> Merge pull request #15 from fenekku/master
* vendor/grammars/SublimePapyrus 152c7b7...2731300 (1):
> Updated INI path setting behavior
* vendor/grammars/actionscript3-tmbundle d69fcc8...d24ad7d (1):
> all contexts
* vendor/grammars/dart-sublime-bundle c1afc62...d55b1d4 (4):
> Merge pull request #458 from guillermooo-forks/prep-release
> Merge pull request #457 from guillermooo-forks/refactor
> Merge pull request #455 from guillermooo-forks/fix-stagehand-unavailable
> Merge pull request #452 from guillermooo-forks/improve-syntax-def
* vendor/grammars/grace-tmbundle c342d35...acbf9a2 (9):
> Add simple block parameter highlighting
> Track open braces for better interpolation
> Add highlighting for full import syntax
> Check for extra word characters after var keyword
> Remove built-ins and change storage to support
> Highlight untyped block parameters
> Highlight interpolation braces as keywords
> Highlight only capitalised words with generic args
> Include comment highlighting in every construct
* vendor/grammars/language-javascript ac37d2a...d58edec (2):
> Prepare 0.57.0 release
> Merge pull request #101 from postcasio/iojs-shebang
* vendor/grammars/latex.tmbundle 0441781...669040b (1):
> Fix doctest for `run_biber` in `texmate`
* vendor/grammars/mako-tmbundle e039636...da79638 (1):
> Merge pull request #7 from seedofjoy/patch-1
* vendor/grammars/sublime-text-ox bdd03e0...10ca883 (5):
> Update README.md
> Update README.md
> Moved license to separate md-file.
> Ctrl+B executes on a single core instaed of two.
> Added patterns for 'foreach' and 'delete'.
* vendor/grammars/GDScript-sublime 99a0d51...44ac5c4 (3):
> Merge pull request #7 from erbridge/null-keyword
> Merge pull request #6 from erbridge/assert-keyword
> Merge pull request #5 from erbridge/update-yaml
* vendor/grammars/Modelica d7e50e3...f2b1242 (8):
> Update README.md
> Update README.md
> Update README.md
> Update README.md
> Update README.md
> Update README.md
> Delete .gitattributes
> Create .gitattributes
* vendor/grammars/NimLime 7581153...58a1e0c (5):
> Merge pull request #13 from fenekku/master
> Refactored a bit nimsuggest service hosting a bit more robust
> Print error if nimsuggest does not respond
> Close test sock Turn off autoreload
> Merge pull request #14 from Varriount/update-to-sockets
* vendor/grammars/Sublime-SQF-Language 708c78a...0313fbe (1):
> Merge pull request #12 from DenVdmj/master
* vendor/grammars/SublimePapyrus 5a7b3e7...152c7b7 (1):
> Added setting
* vendor/grammars/ats.sublime d954ef6...2565468 (2):
> fix record/tuple/then/else with {
> fix bugs for single quote char
* vendor/grammars/c.tmbundle f825425...f6048af (1):
> Add syntax highlight for CoreGraphics types
* vendor/grammars/dart-sublime-bundle fecdbc5...c1afc62 (4):
> Merge pull request #450 from guillermooo-forks/prep-release
> Merge pull request #449 from guillermooo-forks/fix-analysis-server-init
> Merge pull request #448 from guillermooo-forks/prep-release
> Merge pull request #446 from guillermooo-forks/new-analysis-server-integration-linting
* vendor/grammars/elixir-tmbundle dcf1fc1...9c63ff0 (1):
> Merge pull request #34 from bharendt/master
* vendor/grammars/factor 4ada328...ec896cd (17):
> images.tiff: Fix partial refactor rollback and offeset typo.
> images.tiff: Fix infinite loop bug exposed by AFL test suite. IDFs are found at certain offsets, then the next offset is after the IDF. If a next-offset is its own previous offset, then it would loop. Now we record the offset and stop if it would loop.
> alien.libraries: Cannot include alien.libraries.finder here for docs.
> Explicitly reference find-library in alien docs
> Fix typo in hash-set documentation
> opencl: remove <size_t> (use size_t <ref> instead).
> forestdb.ffi: Update ffi.
> forestdb: Embrace the forestdb handle vs kvs handle idiom. Update tests.
> stack-checker.state: Fix error in docs. Tweak doc grammar.
> bootstrap.image.upload: Use pscp on Windows for uploading boot images since c:\ paths are treated as hostnames and the command fails.
> stack-checker: minor help-lint fixes.
> compiler.tree.*: more compiler tree docs
> stack-checker.*: misc doc additions
> stack-checker.known-words: docs and tests
> stack-checker.values: docs and tests
> stack-checker.state: docs and tests
> stack-checker.backend: docs and tests
* vendor/grammars/fsharpbinding 92d969b...0cd6439 (2):
> revert typo, typo is actually upstream in monodevelop
> bump version number
* vendor/grammars/java.tmbundle a74cb83...ccdebdf (1):
> Highlight volatile like synchronized
* vendor/grammars/javadoc.tmbundle 484d468...5276d7a (1):
> Grammar: Be strict on what can start an HTML tag
* vendor/grammars/language-clojure bae6eee...cfc8a5c (6):
> Prepare 0.12.0 release
> Merge pull request #14 from joelash/master
> Prepare 0.11.0 release
> Merge pull request #13 from hanjos/proposed
> Add initial spec
> Add initial Travis CI config
* vendor/grammars/language-csharp fba368a...d07ba8f (4):
> Prepare 0.5.0 release
> Merge pull request #19 from atom/ks-remove-deprecations
> Prepare 0.4.0 release
> Merge pull request #16 from damieng/master
* vendor/grammars/language-gfm 18400b2...5f5df30 (3):
> Prepare 0.64.0 release
> Add heading spec with no space
> Merge pull request #77 from jonathandelgado/master
* vendor/grammars/language-python 0141d44...8daa100 (4):
> Prepare 0.32.0 release
> Merge pull request #54 from nicktimko/binary-literals
> Prepare 0.31.0 release
> Merge pull request #53 from nicktimko/python-3-octals
* vendor/grammars/latex.tmbundle 16154ce...0441781 (16):
> Remove unnecessary code from tests
> Try to read tex file using different encodings
> Recognize errors in files containing spaces
> Prepend `lib` to path in Python scripts
> Fix minor style issues reported by `flake8`
> Tell `flake8` to ignore “relative” imports
> Use `format` instead of `sprintf`
> Use encoding `latin_1` to open log files
> Add “LaTeX Tidy” to the bundle again
> Add `YAML::Tiny` library to the bundle
> Use `texdoc` to show documentation for single word
> Determine `TEXMFMAIN` only once in `texdoc`
> Autoupdate cache for “Documentation for Package”
> Update “Documentation for Package”
> Use direct imports in `texdoc`
> Add folding markers for sections
* vendor/grammars/objective-c.tmbundle 8387be8...1bade8a (1):
> Add syntax highlight for the typedefs in NSObjCRuntime.h
* vendor/grammars/php.tmbundle 1ae104d...7178a10 (4):
> Doc Snippet: Allow for static keyword in declarations
> Further work on escapes in single-quoted regular expressions
> Grammar: Correct improper '\' escaping
> Improve/simplify escaping rules for single-quoted regexps
* vendor/grammars/sublime-nix 412f7e1...217ffe5 (1):
> Fix comma-first
Documentation is an important part of a software project but is not
generally thought of as part of the code for that project. Repository
language statistics are used to quantify the project's code, so it makes
sense to exclude documentation from those computations.
Documentation files are recognized similarly to vendored files.
lib/linguist/documentation.yml contains regular expressions to match
common names for documentation files. A new linguist-documentation Git
attribute can be used to override those conventions.
Originally, only "programming" languages were included in repository
language statistics. In 33ebee0f6a we
started detecting a few selected "markup" languages as well. We didn't
include all "markup" languages because at the time formats like Markdown
and AsciiDoc were labeled as "markup" languages, and we thought that
including those prose (i.e., non-code) languages in repository
statistics on github.com was misleading for repositories that are
largely about code but also contain a lot of documentation (e.g.,
rails/rails).
This hand-picked set of whitelisted "markup" languages can cause strange
categorization for some repositories. For example, it includes CSS (and
some variants) but not HTML. This results in repositories that contain
the source code for a static website being classified as either a
JavaScript (programming) or CSS (markup) repository, with no mention of
HTML anywhere.
Fast-forward to today, and prose languages are no longer "markup"
languages; they're now "prose" languages. So now we can include all
"markup" languages in repository language statistics without worrying
about undesirable effects for documentation-heavy repositories.
* origin/master: (97 commits)
Modifying some modeline fixtures to test case InSeNsItivitY
Making modelines case-insensitive
Missing whitespace
Vim and Emacs modelines
Update README.md
Update URL for AutoHotkey grammar
Remove grammar for AutoHotkey
Bumping version to v4.3.1
Grammar update
'Text' doesn't qualify as a valid modeline language.
Add .4TH Forth extension.
Grammar for eC from TextMate bundle
Sample for eC
Grammar for Ox from Sublime Text package
Grammar for Grace from TextMate bundle
Grammar for G-Code from Sublime Text package
Grammar for TXL from Sublime Text package
Grammar for J from Sublime Text package
Sample for J
Grammar for Golo from Sublime Text package
...
Conflicts:
README.md
`cpplint.py` is Google's Python script used for linting C++ files.
I have a small C++ project with `cpplint.py` included mistakenly making
Python the main language of my project.
* origin/master: (104 commits)
Added shebang sample for Pike.
Added interpreter "pike" for Pike.
Add support for FXML files.
Add support for Turtle and SPARQL
Fixed issues for web ontology to pass tests
Added Web Ontology Language Support
Simplify blob tests
Use the original FileBlob path for filesystem access
Sample sagews file, as requested
Update languages.yml with *.sagews
New grammar for Racket
Remove grammar for Racket
Modifying BlobHelper and FileBlob to use path
Sample file for .cmake.in
Restore the .cmake.in extension.
More CMake samples.
Updating file regex to support unlicense.txt
Updating ref to include license
Remove pry
Start using path with LazyBlob
...
Conflicts:
CONTRIBUTING.md
README.md
Now that FileBlobs with relative paths can still access their files on
disk, we can use relative paths for all FileBlobs in the test. This more
closely matches the behavior in github.com's codebase, where all blobs
use relative paths.
FileBlob now remembers the full path that was passed to its constructor,
and uses that for performing filesystem access. FileBlob#path continues
to return a relative path as before. This ensures that you can call
methods like #size and #mode on FileBlobs with relative paths,
regardless of the current working directory.
Now that all our grammars are licensed (or grandfathered in), we can
distribute them as part of the standard github-linguist gem. This makes
it easier for projects to get up and running with Linguist.
* The `thread`-gem is required for the script, because otherwise Ruby throws an error that `Queue` in line 259 is an uninitialized constant
* The variable `p` was previously in the same method with the status message saying `OK ‹path› ‹converted scopes›`. But `p` is now defined in load_grammars() and thus not visible when showing the OK-message in install_grammars(). This was solved by adding a path-parameter to install_grammars().
We require all grammars to have a license that permits redistribution. A
few existing grammars have been grandfathered in without a license (and
we're working to remedy that), but no new grammars should be added
without a license.
convert-grammars now supports a few flags that we can use to make it
dump out the YAML just for the local grammar submodules. We can then
compare this to the YAML that's actually in grammars.yml to check that
they're the same. If they aren't, grammars.yml needs to be updated.
This will help catch mistakes like using the wrong scope name.
This was performed via `git submodule update --remote`.
* vendor/grammars/Agda.tmbundle 784f435...68a218c (1):
> Merge pull request #1 from aroben/patch-1
* vendor/grammars/IDL-Syntax 9473b7f...3baeaea (1):
> Merge pull request #3 from aroben/patch-1
* vendor/grammars/NimLime 7a2fb4e...9cef4b6 (4):
> Updated command names
> Updated generated documentation
> renamed more from nimrod to nim
> Renamed several files
* vendor/grammars/SCSS.tmbundle d6188e5...4147502 (1):
> Merge pull request #181 from redgluten/master
* vendor/grammars/Sublime-VimL 6ab7e19...366fdc6 (1):
> Merge pull request #2 from yous/fix-single-quoted-string
* vendor/grammars/factor 2dc5590...2453a78 (38):
> json.writer: make sure we make hex values two digits zero padded.
> json.writer: support escaping unicode > 0x10000. Thanks @jonenst!
> mason.git: fix status check.
> compiler.cfg.*: new unit test vocabs
> compiler.cfg.*: more docs
> compiler.cfg.*: refactoring away the compute-global-sets word
> compiler.cfg.*: docs and more tests
> compiler.cfg.stacks.local: refactoring making stack-changes and height-changes take and return stuff instead of using variables and the make building
> compiler.cfg.parallel-copy: docs
> compiler.cfg.stacks.height: these words are unused
> compiler.cfg.*: more compiler docs
> compiler.cfg.stacks.finalize: initial docs
> io.launcher: fix stack effects.
> io.launcher: fix docs for with-process-reader and with-process-writer.
> io.launcher: add versions of with-process that preserve process and status.
> mason.git: fix use.
> mason.git: fix for rename.
> io.launcher: cleanup public interface, make some things private or internal.
> gopher: set 1 minute timeout by default.
> brainfuck: cleanup tests.
> json.writer: don't escape spaces, thats weird.
> unix: some using cleanups.
> python: rename startup/shutdown hooks.
> math.extras: adding the Möbius function.
> alien.c-types: move definitions of stdint.h from unix.types.
> gopher: use contents now that it works.
> io.ports: Make buffered-port not have a length because of Linux virtual files and TCP sockets. Related to issues #1256 and #1259.
> tools.deploy.backend: add word for deleting cached staging images.
> command-line: save the executable in a variable so that people don't use (command-line) directly if possible.
> bootstrap: fix this use of (command-line).
> tools.deploy.shaker: set the rest of the args to preserve current behavior.
> vm: store full command-line including executable first argument.
> gopher: fix bug where empty lines weren't printed properly in menus.
> gopher: simplify.
> gopher: change gopher-text to use split1.
> io.encodings.detect: simplify prolog-tag.
> gopher: add way to get result without converting to objects.
> tools.disassembler: allow disassemble of compose and curry.
* vendor/grammars/fsharpbinding af755c8...d097476 (24):
> Merge pull request #909 from cbowdon/issue877-vim-73-support
> Merge pull request #913 from 7sharp9/Move_GetColourizations_toBg
> Merge pull request #912 from 7sharp9/TryFind_opt
> Merge pull request #911 from 7sharp9/FoldingParser
> Merge pull request #908 from 7sharp9/TooltipOverhaul_AutoParamFix
> Merge pull request #907 from 7sharp9/Movegetdefinestomodule
> Merge pull request #906 from 7sharp9/tooltipfixforclosures
> Merge pull request #905 from 7sharp9/ResolverProvider_singletimeout
> Merge pull request #904 from fsharp/revert-903-ResolverProvider_singletimeout
> Merge pull request #903 from 7sharp9/ResolverProvider_singletimeout
> Merge pull request #902 from 7sharp9/ParameterCompletion_gatherTimeout
> Merge pull request #901 from 7sharp9/Changed_invalidate_project
> Merge pull request #900 from 7sharp9/Syntaxmode_removeextraoperation
> Merge pull request #899 from 7sharp9/tooltips_ensureTimout
> Merge pull request #898 from 7sharp9/pathextension_useAddRange
> Merge pull request #897 from 7sharp9/resolverprovider_ensuretimout
> Merge pull request #896 from 7sharp9/completion_ensuretimout
> Merge pull request #895 from cbowdon/894-Vim-fix-for-no-completions-stacktrace
> Merge pull request #890 from wangzq/gotodecl
> Merge pull request #893 from 7sharp9/fixfortooltipvaltypes
> Merge pull request #892 from 7sharp9/fixforprojecttypechecking
> Added correct indentation
> Merge pull request #891 from 7sharp9/ImproveImplementInterface
> Merge pull request #888 from VincentDondain/master
* vendor/grammars/haxe-sublime-bundle 58cad47...e2613bb (4):
> fixed goto definition / find type
> clean
> adaptations for toplevel completion
> first test
* vendor/grammars/language-gfm c6df027...7b62290 (7):
> Prepare 0.59.0 release
> scoped-properties -> settings
> Prepare 0.58.0 release
> Merge pull request #67 from davidcelis/master
> Prepare 0.57.0 release
> Prepare 0.56.0 release
> Merge pull request #64 from atom/mb-new-cpp-scope-name
* vendor/grammars/language-javascript 15dc5d1...6690feb (5):
> Prepare 0.52.0 release
> Merge pull request #82 from Hurtak/feature/snippets-for
> Merge pull request #80 from Hurtak/feature/snippets-querySelector
> Merge pull request #79 from Hurtak/feature/snippets-switch-indentation-fix
> Merge pull request #81 from Hurtak/feature/snippets-iife
* vendor/grammars/language-python 476a353...f518e49 (5):
> Prepare 0.28.0 release
> Use trailing scope name
> Merge pull request #48 from msabramo/patch-1
> Prepare 0.27.0 release
> Add pattern for nonlocal keyword
* vendor/grammars/language-sass 064a8b5...33efa33 (2):
> Prepare 0.29.0 release
> Allow + and - in selector argument
* vendor/grammars/language-shellscript e2d62af...cbec163 (2):
> Prepare 0.11.0 release
> Merge pull request #4 from hd-deman/patch-1
* vendor/grammars/latex.tmbundle 682c4b7...52b2251 (42):
> Replaced `python` with `python2.7` in shebangs
> Make the preferences compatible with Python 3
> Handle manual spacing in “Reformat” (Table)
> Fix: Reformatting of table containing empty cells
> Use more descriptive variable names in `format`
> Add documentation to `reformat`
> Fix doctest in `refresh_viewer`
> Add tests for `reformat`
> Ignore “exit discard” status in `cramtests`
> Remove print statements from `reformat` function
> Fix: Close log window option ignored
> Automatically scroll to bottom in “HTML Output”
> Handle “\” signs in the notification window
> Fix missing logname in default error message
> Extend list of auxiliary files
> Remove unused code from `latex_watch`
> Display default message in notification window
> Sort error messages by line number
> Do not store duplicate error messages anymore
> Close notification window on cleanup
> Improve reopening of closed notification windows
> Improve rewrap code in `texparser`
> Improve readability of verbose log output
> Only parse log file if there were changes
> Remove unnecessary function call in “LaTeX Watch”
> Properly close file in `guess_tex_engine`
> Handle log messages containing double quotes
> Left justify severity in notification window
> Handle manual closing of notification window
> Add additional information to notification window
> Remove unused code from `texparser`
> Close notification when typesetting succeeds
> Add support for notifications to “LaTeX Watch”
> Update bundle preference values instantly
> Make “Reformat” (Table) compatible with Ruby 2
> Ignore escaped ampersand `\&` in “Format” (Table)
> Remove warnings reported by `RuboCop`
> Format code for “Reformat” (Table)
> Move code for “Reformat” into separate script
> Save “Reformat” command with TextMate 2
> Remove unused import
> Use explicit import in “Itemize Lines In Selection”
* vendor/grammars/mercury-tmlanguage b5a4fd6...eaef0b0 (8):
> Add require_* and some, all keywords
> Highlight %f format specifiers, `` as op
> Correct implementation of '''', """" and 0'<char>
> README.md: Mention GitHub grammar compatability
> README.md: add resources and demonstration
> reformatted whitespace; added foreign mods; missing keywords
> Highlight variables, determ decls, more pragmas
> no highlighting of variables, function names, type names, inst's, etc.
* vendor/grammars/sublime-mask 2f59519...632ff3c (4):
> v0.8.7
> v0.8.7
> + expression in component nodes
< v0.8.6
* vendor/grammars/swift.tmbundle 81a0164...3c7eac5 (9):
> Use constant scope for booleans
> Use storage scope instead of keyword
> Correct typo in include
> Revamp string literal matching
> Improve punctuation scopes
> Allow for functions without a body
> Add simple folding markers for swift
> Improved matching of capture specifiers
> Add Support for UInt, Int[8|16|32|64] & Float80
We were using a fork to get the fix for
https://github.com/textmate/c.tmbundle/pull/24 before it was merged
upstream. Now it's been merged so we can go back to the upstream
repository.
We tell apt-get to download it to vendor/apt and then install it into a
vendor/icu directory.
We should be able to just specify --with-icu-dir, but apparently Ruby
2.0 (but not 1.9 or 2.1 or 2.2) has a bug that requires us to use
--with-icu-include/--with-icu-lib instead. Otherwise it can't find the
ICU libraries.
This gives us a consistent test framework across all Ruby versions which
should help avoid errors that are only found when CI runs the tests on
different Rubies. (And this fixes an immediate bug where there's no
`skip` method in the version of test-unit we're currently using only on
Ruby 2.2.)
This runs 8 `git submodule update` processes in parallel, speeding up
bootstrap from 2 minutes to 30 seconds for me. (Obviously this is
dependent on bandwidth.)
If any submodules are missing from grammars.yml, or are listed in
grammars.yml but missing from the repo, the test will fail.
Eventually it would be good to test that the scopes for each submodule
are accurate, but that will take some more work.
This makes it so we don't have to redownload all the grammars every time
we build the grammars gem. It will also let us verify that grammars.yml
is accurate in the future by checking it against the submodules on disk.
script/bootstrap now updates the submodules.
While not perfect, source.smalltalk is a better fit for highlighting STON files than source.json. When STON departs from pure JSON (often) the hightlighting is pretty bad.
This grammar uses the same scope name (source.idl) as our existing IDL
grammar. The wrong scope name was listed in grammars.yml which masked
this problem. https://github.com/andik/IDL-Syntax/pull/2 tracks getting
the grammar to use a different scope name; in the meantime we just won't
highlight these files.
It's much cleaner and more robust to specify the repo URL instead of a
URL to an individual file. If the file gets moved we'll still be able to
find it if we're using the repo URL.
Where we do need raw links, we now use github.com/owner/repo/raw/*
because it looks a bit nicer and sorts better with non-raw links.
It must be sorted, because it will get re-sorted when
script/download-grammars is next run and that would clutter up diffs.
And it must not contain any duplicate scopes.
This works better than the old Ruby Sass.tmbundle we were pulling from
svn.textmate.org.
atom/language-sass also contains an SCSS grammar, but I didn't switch to
using that grammar because it isn't obviously better than our current
one and I'm not an SCSS expert.
Adding 'erlang.mk' to list of erlang bundles; it's seeing some adoption in the Erlang community for building Erlang apps, and at 1k lines of code at present can dominate an initial check-in, project skeleton, or small library.
See https://github.com/ninenines/erlang.mk for further details.
Some languages are sensitive to file names in the sense that
different kinds of files contain somewhat different data.
Example: GAP .tst files contain test cases, which add some
extra data compared to regular code, and as a consequence are
not directly interchangeable with regular source code.
Heuristics may need to take this into account, thus may need
to know the name of the file being analyzed.
...to avoid collision with Clean language as well
as the .dcl extension can be seen only in some special
cases -- especially in context of DCL emulation tools
for non-OpenVMS systems (probably to avoid potential
confusion with MS-DOS .com files).
Almost all bug fixes or new language additions should come with some additional code samples. Just drop them under [`samples/`][samples] in the correct subdirectory and our test suite will automatically test them. In most cases you shouldn't need to add any new assertions.
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code.
### My code is detected as the wrong language
The majority of contributions won't need to touch any Ruby code at all.
This can usually be solved either by adding a new filename or file name extension to the language's entry in [`languages.yml`][languages] or adding more [samples][samples] for your language to the repository to make Linguist's classifier smarter.
## Adding an extension to a language
### Syntax highlighting looks wrong
We try only to add new extensions once they have some usage on GitHub. In most cases we prefer that extensions be in use in hundreds of repositories before supporting them in Linguist.
Assuming your code is being detected as the right language (see above), in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream.
To add support for a new extension:
You can also try to fix the bug yourself and submit a Pull Request. [This piece from TextMate's documentation](http://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars. You can test grammars using [Lightshow](https://lightshow.githubapp.com).
0. Add your extension to the language entry in [`languages.yml`][languages], keeping the extensions in alphabetical order.
0. Add at least one sample for your extension to the [samples directory][samples] in the correct subdirectory.
0. Open a pull request, linking to a [GitHub search result](https://github.com/search?utf8=%E2%9C%93&q=extension%3Aboot+NOT+nothack&type=Code&ref=searchresults) showing in-the-wild usage.
Once the bug has been fixed upstream, please let us know and we'll pick it up for GitHub.
In addition, if this extension is already listed in [`languages.yml`][languages] then sometimes a few more steps will need to be taken:
### I want to add support for the `X` programming language
0. Make sure that example `.yourextension` files are present in the [samples directory][samples] for each language that uses `.yourextension`.
0. Test the performance of the Bayesian classifier with a relatively large number (1000s) of sample `.yourextension` files. (ping @arfon or @bkeepers to help with this) to ensure we're not misclassifying files.
0. If the Bayesian classifier does a bad job with the sample `.yourextension` files then a [heuristic](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.rb) may need to be written to help.
Great! You'll need to:
## Adding a language
We try only to add languages once they have some usage on GitHub. In most cases we prefer that each new file extension be in use in hundreds of repositories before supporting them in Linguist.
To add support for a new language:
0. Add an entry for your language to [`languages.yml`][languages].
0. Add a grammar for your language to [`grammars.yml`][grammars] by running `script/download-grammars --add URL`. Please only add grammars that have a license that permits redistribution.
0. Add samples for your language to the [samples directory][samples].
0. Add a grammar for your language. Please only add grammars that have a license that permits redistribution.
0. Add your grammar as a submodule: `git submodule add https://github.com/JaneSmith/MyGrammar vendor/grammars/MyGrammar`.
0. Add your grammar to [`grammars.yml`][grammars] by running `script/convert-grammars --add vendor/grammars/MyGrammar`.
0. Add samples for your language to the [samples directory][samples] in the correct subdirectory.
0. Open a pull request, linking to a [GitHub search result](https://github.com/search?utf8=%E2%9C%93&q=extension%3Aboot+NOT+nothack&type=Code&ref=searchresults) showing in-the-wild usage.
We try only to add languages once they have some usage on GitHub, so please note in-the-wild usage examples in your pull request. In most cases we prefer that languages already be in use in hundreds of repositories before supporting them in Linguist.
In addition, if your new language defines an extension that's already listed in [`languages.yml`][languages] (such as `.foo`) then sometimes a few more steps will need to be taken:
0. Make sure that example `.foo` files are present in the [samples directory][samples] for each language that uses `.foo`.
0. Test the performance of the Bayesian classifier with a relatively large number (1000s) of sample `.foo` files. (ping @arfon or @bkeepers to help with this) to ensure we're not misclassifying files.
0. If the Bayesian classifier does a bad job with the sample `.foo` files then a [heuristic](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.rb) may need to be written to help.
Remember, the goal here is to try and avoid false positives!
## Fixing a misclassified language
Most languages are detected by their file extension defined in [languages.yml][languages]. For disambiguating between files with common extensions, linguist applies some [heuristics](/lib/linguist/heuristics.rb) and a [statistical classifier](lib/linguist/classifier.rb). This process can help differentiate between, for example, `.h` files which could be either C, C++, or Obj-C.
Misclassifications can often be solved by either adding a new filename or extension for the language or adding more [samples][samples] to make the classifier smarter.
## Fixing syntax highlighting
Syntax highlighting in GitHub is performed using TextMate-compatible grammars. These are the same grammars that TextMate, Sublime Text and Atom use. Every language in [languages.yml][languages] is mapped to its corresponding TM `scope`. This scope will be used when picking up a grammar for highlighting.
Assuming your code is being detected as the right language, in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream. If you can, try to reproduce the highlighting problem in the text editor that the grammar is designed for (TextMate, Sublime Text, or Atom) and include that information in your bug report.
You can also try to fix the bug yourself and submit a Pull Request. [TextMate's documentation](https://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars. You can test grammars using [Lightshow](https://github-lightshow.herokuapp.com).
Once the bug has been fixed upstream, we'll pick it up for GitHub in the next release of Linguist.
## Testing
For development you are going to want to checkout out the source. To get it, clone the repo and run [Bundler](http://gembundler.com/) to install its dependencies.
git clone https://github.com/github/linguist.git
cd linguist/
script/bootstrap
To run the tests:
bundle exec rake test
Sometimes getting the tests running can be too much work, especially if you don't have much Ruby experience. It's okay: be lazy and let our build bot [Travis](https://travis-ci.org/#!/github/linguist) run the tests for you. Just open a pull request and the bot will start cranking away.
Here's our current build status: [](https://travis-ci.org/github/linguist)
## Releasing
If you are the current maintainer of this gem:
0. Create a branch for the release: `git checkout -b cut-release-vxx.xx.xx`
0. Make sure your local dependencies are up to date: `script/bootstrap`
0. If grammar submodules have not been updated recently, update them: `git submodule update --remote && git commit -a`
0. Ensure that samples are updated: `bundle exec rake samples`
0. Ensure that tests are green: `bundle exec rake test`
0. Bump gem version in `lib/linguist/version.rb`, [like this](https://github.com/github/linguist/commit/8d2ea90a5ba3b2fe6e1508b7155aa4632eea2985).
0. Make a PR to github/linguist, [like this](https://github.com/github/linguist/pull/1238).
0. Build a local gem: `bundle exec rake build_gem`
0. Test the gem:
0. Bump the Gemfile and Gemfile.lock versions for an app which relies on this gem
0. Install the new gem locally
0. Test behavior locally, branch deploy, whatever needs to happen
0. Merge github/linguist PR
0. Tag and push: `git tag vx.xx.xx; git push --tags`
0. Push to rubygems.org -- `gem push github-linguist-3.0.0.gem`
We use this library at GitHub to detect blob languages, ignore binary files, suppress generated files in diffs, and generate language breakdown graphs.
Tips for filing issues and creating pull requests can be found in [`CONTRIBUTING.md`](/CONTRIBUTING.md).
This library is used on GitHub.com to detect blob languages, ignore binary or vendored files, suppress generated files in diffs, and generate language breakdown graphs.
## Features
See [Troubleshooting](#troubleshooting) and [`CONTRIBUTING.md`](/CONTRIBUTING.md) before filing an issue or creating a pull request.
### Language detection
## Troubleshooting
Linguist defines a list of all languages known to GitHub in a [yaml file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
### My repository is detected as the wrong language
Most languages are detected by their file extension. For disambiguating between files with common extensions, we first apply some common-sense heuristics to pick out obvious languages. After that, we use a
The Language stats bar displays languages percentages for the files in the repository. The percentages are calculated based on the bytes of code for each language as reported by the [List Languages](https://developer.github.com/v3/repos/#list-languages) API. If the bar is reporting a language that you don't expect:
0. Click on the name of the language in the stats bar to see a list of the files that are identified as that language.
0. If you see files that you didn't write, consider moving the files into one of the [paths for vendored code](/lib/linguist/vendor.yml), or use the [manual overrides](#overrides) feature to ignore them.
0. If the files are being misclassified, search for [open issues][issues] to see if anyone else has already reported the issue. Any information you can add, especially links to public repositories, is helpful.
0. If there are no reported issues of this misclassification, [open an issue][new-issue] and include a link to the repository or a sample of the code that is being misclassified.
Linguist supports a number of different custom overrides strategies for language definitions and vendored paths.
### Using gitattributes
Add a `.gitattributes` file to your project and use standard git-style path matchers for the files you want to override to set `linguist-documentation`, `linguist-language`, and `linguist-vendored`. `.gitattributes` will be used to determine language statistics, but will not be used to syntax highlight files. To manually set syntax highlighting, use [Vim or Emacs modelines](#using-emacs-or-vim-modelines).
```
$ cat .gitattributes
*.rb linguist-language=Java
```
See [lib/linguist/language.rb](https://github.com/github/linguist/blob/master/lib/linguist/language.rb) and [lib/linguist/languages.yml](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
Checking code you didn't write, such as JavaScript libraries, into your git repo is a common practice, but this often inflates your project's language stats and may even cause your project to be labeled as another language. By default, Linguist treats all of the paths defined in [lib/linguist/vendor.yml](https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml) as vendored and therefore doesn't include them in the language statistics for a repository.
### Syntax Highlighting
Use the `linguist-vendored` attribute to vendor or un-vendor paths.
Syntax highlighting in GitHub is performed using TextMate-compatible grammars. These are the same grammars that TextMate, Sublime Text and Atom use.
```
$ cat .gitattributes
special-vendored-path/* linguist-vendored
jquery.js linguist-vendored=false
```
Every language in `languages.yml` is mapped to its corresponding TM `scope`. This scope will be used when picking up a grammar for highlighting. **When adding a new language to Linguist, please add its corresponding scope too (assuming there's an existing TextMate bundle, Sublime Text package, or Atom package) so syntax highlighting works for it**.
Similar to vendored files, Linguist excludes documentation files from your project's language stats. (Unlike vendored files, documentation files are displayed in diffs on github.com.) [lib/linguist/documentation.yml](lib/linguist/documentation.yml) lists common documentation paths and excludes them from the language statistics for your repository.
### Stats
Use the `linguist-documentation` attribute to mark or unmark paths as documentation.
The Language stats bar that you see on every repository is built by aggregating the languages of each file in that repository. The top language in the graph determines the project's primary language.
```
$ cat .gitattributes
project-docs/* linguist-documentation
docs/formatter.rb linguist-documentation=false
```
The repository stats API, accessed through `#languages`, can be used on a directory:
### Using Emacs or Vim modelines
***API UPDATE***
Alternatively, you can use Vim or Emacs style modelines to set the language for a single file. Modelines can be placed anywhere within a file and are respected when determining how to syntax-highlight a file on GitHub.com
Since [Version 3.0.0](https://github.com/github/linguist/releases/tag/v3.0.0) Linguist expects a git repository (in the form of a [Rugged::Repository](https://github.com/libgit2/rugged#repositories)) to be passed when initializing `Linguist::Repository`.
##### Vim
```
# Some examples of various styles:
vim: syntax=java
vim: set syntax=ruby:
vim: set filetype=prolog:
vim: set ft=cpp:
```
##### Emacs
```
-*- mode: php;-*-
```
## Usage
Install the gem:
```
$ gem install github-linguist
```
Then use it in your application:
```ruby
require'rugged'
@@ -51,146 +91,32 @@ project.language #=> "Ruby"
project.languages#=> { "Ruby" => 119387 }
```
These stats are also printed out by the `linguist`binary. You can use the
These stats are also printed out by the `linguist`executable. You can use the
`--breakdown` flag, and the binary will also output the breakdown of files by language.
You can try running `linguist` on the root directory in this repository itself:
$ bundle exec linguist --breakdown
```
$ bundle exec linguist --breakdown
100.00% Ruby
100.00% Ruby
Ruby:
Gemfile
Rakefile
bin/linguist
github-linguist.gemspec
lib/linguist.rb
lib/linguist/blob_helper.rb
lib/linguist/classifier.rb
lib/linguist/file_blob.rb
lib/linguist/generated.rb
lib/linguist/heuristics.rb
lib/linguist/language.rb
lib/linguist/lazy_blob.rb
lib/linguist/md5.rb
lib/linguist/repository.rb
lib/linguist/samples.rb
lib/linguist/tokenizer.rb
lib/linguist/version.rb
test/test_blob.rb
test/test_classifier.rb
test/test_heuristics.rb
test/test_language.rb
test/test_md5.rb
test/test_pedantic.rb
test/test_repository.rb
test/test_samples.rb
test/test_tokenizer.rb
#### Ignore vendored files
Checking other code into your git repo is a common practice. But this often inflates your project's language stats and may even cause your project to be labeled as another language. We are able to identify some of these files and directories and exclude them.
See [Linguist::BlobHelper#vendored?](https://github.com/github/linguist/blob/master/lib/linguist/blob_helper.rb) and [lib/linguist/vendor.yml](https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml).
## Contributing
#### Generated file detection
Please check out our [contributing guidelines](CONTRIBUTING.md).
Not all plain text files are true source files. Generated files like minified js and compiled CoffeeScript can be detected and excluded from language stats. As an extra bonus, these files are suppressed in diffs.
The language grammars included in this gem are covered by their repositories'
respective licenses. `grammars.yml` specifies the repository for each grammar.
See [Linguist::Generated#generated?](https://github.com/github/linguist/blob/master/lib/linguist/generated.rb).
## Overrides
Linguist supports custom overrides for language definitions and vendored paths. Add a `.gitattributes` file to your project using the keys `linguist-language` and `linguist-vendored` with the standard git-style path matchers for the files you want to override.
Please note that the overrides currently only affect the language statistics for a repository and not the syntax-highlighting of files.
```
$ cat .gitattributes
*.rb linguist-language=Java
$ linguist --breakdown
100.00% Java
Java:
ruby_file.rb
```
By default, Linguist treats all of the paths defined in [lib/linguist/vendor.yml](https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml) as vendored and therefore doesn't include them in the language statistics for a repository. Use the `linguist-vendored` attribute to vendor or un-vendor paths.
```
$ cat .gitattributes
special-vendored-path/* linguist-vendored
jquery.js linguist-vendored=false
```
## Installation
Github.com is usually running the latest version of the `github-linguist` gem that is released on [RubyGems.org](http://rubygems.org/gems/github-linguist).
But for development you are going to want to checkout out the source. To get it, clone the repo and run [Bundler](http://gembundler.com/) to install its dependencies.
git clone https://github.com/github/linguist.git
cd linguist/
bundle install
To run the tests:
bundle exec rake test
### A note on language extensions
Linguist has a number of methods available to it for identifying the language of a particular file. The initial lookup is based upon the extension of the file, possible file extensions are defined in an array called `extensions`. Take a look at this example for example for `Perl`:
```
Perl:
type: programming
ace_mode: perl
color: "#0298c3"
extensions:
- .pl
- .PL
- .perl
- .ph
- .plx
- .pm
- .pod
- .psgi
interpreters:
- perl
```
Any of the extensions defined are valid but the first in this array should be the most popular.
### Testing
Sometimes getting the tests running can be too much work, especially if you don't have much Ruby experience. It's okay: be lazy and let our build bot [Travis](http://travis-ci.org/#!/github/linguist) run the tests for you. Just open a pull request and the bot will start cranking away.
Here's our current build status, which is hopefully green: [](http://travis-ci.org/github/linguist)
### Releasing
If you are the current maintainer of this gem:
0. Create a branch for the release: `git checkout -b cut-release-vxx.xx.xx`
0. Make sure your local dependencies are up to date: `bundle install`
0. Ensure that samples are updated: `bundle exec rake samples`
0. Ensure that tests are green: `bundle exec rake test`
0. Bump gem version in `lib/linguist/version.rb`. For example, [like this](https://github.com/github/linguist/commit/8d2ea90a5ba3b2fe6e1508b7155aa4632eea2985).
0. Make a PR to github/linguist. For example, [#1238](https://github.com/github/linguist/pull/1238).
0. Build a local gem: `bundle exec rake build_gem`
0. Testing:
0. Bump the Gemfile and Gemfile.lock versions for an app which relies on this gem
0. Install the new gem locally
0. Test behavior locally, branch deploy, whatever needs to happen
0. Merge github/linguist PR
0. Tag and push: `git tag vx.xx.xx; git push --tags`
0. Push to rubygems.org -- `gem push github-linguist-3.0.0.gem`
All other files are covered by the MIT license, see `LICENSE`.
This API example demonstrates how to describe body attributes of a request or response message.
In this case, the description is complementary (and duplicate!) to the provided JSON example in the body section. The [Advanced Attributes](09.%20Advanced%20Attributes.md) API example will demonstrate how to avoid duplicates and how to reuse attributes descriptions.
## API Blueprint
+ [Previous: Parameters](07.%20Parameters.md)
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/08.%20Attributes.md)
This is one of the simplest APIs written in the **API Blueprint**.
One plain resource combined with a method and that's it! We will explain what is going on in the next installment - [Resource and Actions](02.%20Resource%20and%20Actions.md).
**Note:** As we progress through the examples, do not also forget to view the [Raw](https://raw.github.com/apiaryio/api-blueprint/master/examples/01.%20Simplest%20API.md) code to see what is really going on in the API Blueprint, as opposed to just seeing the output of the Github Markdown parser.
Also please keep in mind that every single example in this course is a **real API Blueprint** and as such you can **parse** it with the [API Blueprint parser](https://github.com/apiaryio/drafter) or one of its [bindings](https://github.com/apiaryio/drafter#bindings).
## API Blueprint
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/01.%20Simplest%20API.md)
+ [Next: Resource and Actions](02.%20Resource%20and%20Actions.md)
! Only grow the internal string if the result of the cat will be larger than the string currently is.
! The reason for the "+2" is because this is used in the string slicing outside this IF. Without this matching +2 there is potential for an out of bounds slice which would be bad!
! Save a temporary copy of the old string so we can us it in the concatination after we have grown it!
// not established yet or returning packets for a connection that was
// established from this host itself.
established_class[0] ->
firewall :: IPClassifier(dst tcp port ssh,
dst tcp port smtp,
dst tcp port domain,
dst udp port domain,
icmp type echo-reply,
proto icmp,
port > 4095,
-);
firewall[0] -> ip_to_host; // ssh
firewall[1] -> ip_to_host; // smtp
firewall[2] -> ip_to_host; // domain (t)
firewall[3] -> ip_to_host; // domain (u)
firewall[4] -> [0]irw; // icmp reply
firewall[5] -> [0]ierw; // other icmp
firewall[6] -> ip_to_host; // port > 4095, probably for connection
// originating from host itself
firewall[7] -> Discard; // don't allow incoming for port <= 4095
// established connection
established_class[1] -> ip_to_intern;
// To eth0-in. Only accept from inside network.
ipclass[1] -> IPClassifier(src net eth0-in) -> ip_to_host;
// Packets from eth0-in:net either stay on local network or go to the wild.
// Those that go into the wild need to go through the appropriate rewriting
// element. (Either UDP/TCP rewriter or ICMP rewriter.)
ipclass[2] -> inter_class :: IPClassifier(dst net eth0-in, -);
inter_class[0] -> ip_to_intern;
inter_class[1] -> ip_udp_class :: IPClassifier(tcp or udp,
icmp type echo);
ip_udp_class[0] -> [0]rw;
ip_udp_class[1] -> [0]irw;
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.