Skip to content

Commit

Permalink
Sync development files.
Browse files Browse the repository at this point in the history
  • Loading branch information
envygeeks committed Oct 30, 2018
1 parent ff19319 commit e34c06f
Show file tree
Hide file tree
Showing 17 changed files with 495 additions and 77 deletions.
8 changes: 8 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "2"
plugins:
rubocop:
enabled: false
ratings:
paths:
- "spec/tests/**.rb"
- "lib/**.rb"
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
indent_size = 2
1 change: 1 addition & 0 deletions .github/codeowners
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @envygeeks
56 changes: 56 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!--
If this is a security related bug, please email the maintainer of this
repository (found via `CODEOWNERS`) and let them know in private... all
security issues are handled promptly, and quickly, however an early
release could severely impact people.
-->

- [ ] I tried updating to the latest version
- [ ] I can't, there is an issue
- [ ] This is about an < latest
- [ ] I understand older versions may be unsupported
- [ ] I Am on Windows
- [ ] Ubuntu Bash on Windows
- [ ] Fedora Bash on Windows
- [ ] Other Bash on Windows
- [ ] I Am on Linux
- [ ] Ubuntu
- [ ] Fedora
- [ ] CentOS
- [ ] Redhat
- [ ] Debian
- [ ] I am on macOS 10.13
- [ ] I am on macOS 10.14
- [ ] I'm on Docker
- [ ] I understand Docker may be unsupported

## Description

<!--
Replace this with a description of your issue. Try to be as
detailed as you can, because the lack of a detailed description
will not help us reproduce it, and if we cannot reproduce and
you do not answer, your ticket could be closed.
-->

## Steps

- Step 1
- Step 2
- Step 3

## Output

```sh
# Doing stuff.
# Doing more stuff.
# Oh no error.
```

## Expected

<!--
Replace this with what you expected to happen.
Sometimes there are bugs, sometimes it's just a feature,
but it's always nice to know what you wanted.
-->
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- [ ] I have added or updated the specs/tests.
- [ ] I have verified that the specs/tests pass on my computer.
- [ ] I have not attempted to bump, or alter versions.
- [ ] This is a documentation change.
- [ ] This is a source change.

## Description

<!--
What issue are you trying to resolve?
It's always nice to get a brief description.
Note: you should provide the same in your commit message.
not everybody uses Github's Web UI.
-->
42 changes: 42 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Contributor Covenant Code of Conduct
## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Gracefully accepting constructive criticism
* Being respectful of differing viewpoints and experiences
* Showing empathy towards other community members
* Focusing on what is best for the community
* Using welcoming and inclusive language

Examples of unacceptable behavior by participants include:

* Trolling, insulting/derogatory comments, and personal or political attacks
* Publishing private info, such as a physical, or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
* Sexualized language, or imagery, and unwelcome sexual attention or advances
* Public, or private harassment

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at `jordon@envygeeks.io`. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4<br>
Available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
130 changes: 130 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
[@envygeeks]: https://github.com/envygeeks

# Contributing

**Hi!** *Thanks for considering a contribution to this project*. Below you will find a short set of guidelines to help you with your contribution. Be it a bug report, a pull request, or even a question. Let me also let you know that you don't have to file a pull-request, or contribute "raw code" to this project. I would never ask you to do that if you do not wish to, or currently are unable to. All I ask is that you file bug reports, and be respectful of the fact that this software is provided for free, on a donation basis, and at mostly [@envygeeks] expense via time (and sometimes cash.)

## Dependencies

This project has an almost strict policy on dependencies. I do not do major updates (major version updates) of our current dependencies in anything but major releases, regardless of backwards compatibility. Dependencies are locked until the next major version. If there is a security reason for a major update, I ask that you file a bug with the upstream library and ask them to cut a minor release of the last release, which is proper.

***If they cannot provide a security update for the latest version, I will consider adding the major version as an optional version, but not restricting it as the only acceptable starting version, but I will complain about having to do so, because that's not cool.***

### Languages

When it comes to the language versions I support, if a language version becomes EOL (end-of-life) before a major release can be made, I will remove all official support for it before a major release, and update the list of supported versions inside of the testing. This is done to encourage users to keep updating quickly, rather than remaining on old, unstable, and unsupported versions of the language.

#### Policies

I tend to test on more than one version, and more than one back version of any given language if a major update hasn't been done in a while, and continue to support them as long as they are not end-of-life. For example, if my software starts with Ruby `2.2`, and the version is currently `2.5`, and I have no plans for a major update you can add `2.5` to the list of supported Rubies, however, the next major update will drop it to `2.4`, and `2.5`. If `2.2` becomes end-of-life, I will also drop it from the list.

* **Ruby:** Latest + 1 Back
* **JRuby:** Latest Release ***only***
* **Rubinius:** We do not support Rubinius at all.
* **Node.js:** Latest LTS + Latest Release + 1 Back
* **Go:** Latest + 1 Back

***It should be noted that if I wish to have a feature of a language before I can make a major release, I may, or may not go ahead and enforce a newer version of a language in a point release (exp: 3.x) so that I can update my code and clean it up.***


## Bugs/Features

***If you do not wish to (or are unable to) file a pull-request, you can file a bug report for any issue you have...*** as long as it is not a question. Issues include *random results*, *random errors*, *segfaults*, or anything of that nature. When you do, please make sure to include the system you are working from, the version of the language or compiler you are working with, and any relevant information that can be used to replicate the issue. ***Unreplicable issues will be closed.*** ***You can (and are encouraged to) ask questions if they are about something not documented, or if there is a question about an ambiguity in the documentation, this will prompt me to update the documentation to fix the problem.***

### What to not do

* Ask me to put an urgency on your issue.
* Be disrespectful: **I will block your comments**.
* ":+1:" comments, I will lock issues; preventing further comments.
* If you wish to "👍", "👎", or otherwise, please us the emoji-voting.
* Ask if there are "any updates"

**I do accept donations for fixing issues on a case-by-case urgency basis, as well as for creating features, if you need an issue addressed quickly. If you wish to do this you should contact [@envygeeks]. Otherwise issues are fixed based on complexity, time, and importance. All my projects get equal love, and sometimes it takes a minute to get back around.**

### Policies
#### Closing
* **Immediately:** `wontfix`, `stale`, `not-a-bug`
* **Closed on Next Release:** `close-on-next-release`
* **1 Week (7 Days)**: `pending-feedback`

#### Fixing
* **Bugfix x.x.X:** `bug`, `blocker`
* **Minor x.X.x:** `non-blocker`, `bug`, `feature`
* **Immediately:** `documentation`

## Pull Requests
### Tests

If you change a method in any way, your tests ***must*** pass, and if there is an additional surface added, then you ***must add tests***, in Ruby I generally prefer to use RSpec, you should refer to RSpec's documentation for information on how it works, in Go, I prefer to use Go's native testing.

* ***Ruby:*** `rake spec`
* ***Go:*** `go test -cover -v`
* `script/test`

### Code

Code updates should follow the formatting of the given repository, formatting in Ruby is generally done via `rubocop` and is generally tied into `rake` and `rake spec`. Changes that are unrelated will be rejected and asked to be removed, regardless of your personal preference. You can always port those unrelated changes into another pull-request, unless they are arbitrary.

#### Basics

* Write your code in a clean and readable format.
* Comment your code, at the high level, not lots of inline comments.
* Stay at 80 lines if you can.

##### Good

```ruby
# --
# @param hello [String] your greeting
# Allows you to send a greeting back to the user
# @raise if the given object is not a string
# @return [String] the greeting
# --
def greet(hello)
raise ArgumentError, "needs string" unless hello.is_a?(String)
alert hello, {
class: ".greeting"
}
end
```

##### Bad

```ruby
# --
# @param hello [String] your greeting
# Allows you to send a greeting back to the user
# @return [String] the greeting
# --
def greet(hello)
# @raise if the given object is not a string
raise ArgumentError, "needs string" unless hello.is_a?(String)
# Ship it to the user
alert hello, {
class: ".greeting"
}
end
```

#### Commits

Your pull-request should not add additional information outside of the Git-Commit. I understand this is Github, but explanitory data should remain in Git itself, not within Github (for the most part.) You should put the comment body of your pull request inside of your commit.

```
Message
This pull-request solves X issue because it was really buggy.
Please do not add extra `\n\n` here because Github displays it
badly, so just let it flow, besides, this is what was intended for
Git anyways, you only keep your message at 80c.
```


### Documentation

Documentation updates should follow the formatting of the given repository. You will be required to go through an approval process and even a comment processes. This process is mostly simple and should not impede a quick resolution. You should be prepared for the following:

* Requests for unrelated changes to be removed.
* Requests for language changes if the author feels it's ambiguous.
* Requests for formatting changes.
* Requests for `git squash`
85 changes: 8 additions & 77 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,81 +1,12 @@
# Frozen-string-literal: true
# Copyright: 2015 - 2017 Jordon Bedwell - MIT License
# Copyright: 2017 - 2018 - MIT License
# Source: https://github.com/envygeeks/devfiles
# Author: Jordon Bedwell
# Encoding: utf-8

require "open3"
require "rspec/core/rake_task"
require_relative "benchmark/support/task"
require "rubocop/rake_task"
require "simple/ansi"
require "pathutil"
require "json"

# --

task :default => [
ENV["BENCHMARK"] ? :benchmark : :spec
]

# --

BenchmarkTask.new :benchmark
RSpec::Core::RakeTask.new :spec
task :test => :spec

# --

namespace :diff do
desc "List methods we have that Pathname doesn't."
task :methods do
methods = Pathutil.instance_methods - Pathname.instance_methods - Object.instance_methods
methods.each do |method|
$stdout.print "- ", "`", method, "`", "\n"
end
end
end

# --

namespace :missing do
desc "List methods we are missing."
task :methods do
methods = Pathname.instance_methods - Pathutil.instance_methods - Object.instance_methods
methods-= [
:cleanpath
]

methods.each do |method|
$stdout.puts method
end
end
end

# --

namespace :pathname do
desc "List all of Pathnames methods."
task :methods do
methods = Pathname.instance_methods - Object.instance_methods
methods.each_with_index do |method, index|
$stdout.print method
unless index == methods.size - 1
$stdout.print ", "
end
end

$stdout.puts
end
end

# --

desc "List all of Pathutils methods."
task :methods do
methods = Pathutil.instance_methods - Object.instance_methods
methods.each_with_index do |method, index|
$stdout.print "`", method, "`"
$stdout.print ", " unless index == methods.size - 1
end

$stdout.puts
task default: [:spec]
task(:spec) { exec "script/test" }
task(:test) { exec "script/test" }
Dir.glob("script/rake.d/*.rake").each do |v|
load v
end
20 changes: 20 additions & 0 deletions script/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Copyright: 2017 - 2018 - MIT License
# Source: https://github.com/envygeeks/devfiles
# Author: Jordon Bedwell
[ "$DEBUG" = "true" ] && set -x
set -e

f=script/script.d/install
[ "$SKIP_SCRIPTD" != "true" ] && [ -x $f ] && exec $f "$@"
if bundle check 1>/dev/null 2>&1; then
bundle update
else
bundle install --path \
vendor/bundle
fi

bundle clean
if [ -f package.json ]; then
yarn
fi
21 changes: 21 additions & 0 deletions script/rake.d/default.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require "bundler/setup"

require "open3"
require "rspec/core/rake_task"
require_relative "../../benchmark/support/task"
require "rubocop/rake_task"
require "simple/ansi"
require "pathutil"
require "json"

# --

task :default => [
ENV["BENCHMARK"] ? :benchmark : :spec
]

# --

BenchmarkTask.new :benchmark
RSpec::Core::RakeTask.new :spec
task :test => :spec

0 comments on commit e34c06f

Please sign in to comment.