Skip to content

Commit

Permalink
Removing ktlint dependencies in diKTat project. (#9)
Browse files Browse the repository at this point in the history
* Removing ktlint dependencies in diKTat project.

### What's done:
[x] Removed everything related to dependecies
[] Project is still using non-fork version of ktlint, so there can be some possible issues with the build
  • Loading branch information
orchestr7 authored Jul 3, 2020
1 parent d109aeb commit f10f668
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 124 deletions.
38 changes: 6 additions & 32 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
# Code of Conduct

At Pinterest, we work hard to ensure that our work environment is welcoming
and inclusive to as many people as possible. We are committed to creating this
environment for everyone involved in our open source projects as well. We
welcome all participants regardless of ability, age, ethnicity, identified
gender, religion (or lack there of), sexual orientation and socioeconomic
status.

This code of conduct details our expectations for upholding these values.
This is a small code of conduct to have a good and friendly development in diKTat

## Good behavior

We expect members of our community to exhibit good behavior including (but of
course not limited to):

- Using intentional and empathetic language.
- Focusing on resolving instead of escalating conflict.
- Providing constructive feedback.
We expect everyone to love each other, be kind and polite.
Do not hate anyone for comments on the review or for bugs that he (or she) made in his code.

## Unacceptable behavior

Some examples of unacceptable behavior (again, this is not an exhaustive
list):

- Harassment, publicly or in private.
- Trolling.
- Sexual advances (this isn’t the place for it).
- Publishing other’s personal information.
- Any behavior which would be deemed unacceptable in a professional environment.

## Recourse

If you are witness to or the target of unacceptable behavior, it should be
reported to Pinterest at [email protected]. All reporters will
be kept confidential and an appropriate response for each incident will be
evaluated.

If the maintainers do not uphold and enforce this code of conduct in
good faith, community leadership will hold them accountable.
But if you would like to bully some of our contributors - you are always welcome.
We love critics and do not like to be in comfort zone.
We can even organize some underground boxing match for you somewhere in Russia.
66 changes: 12 additions & 54 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,21 @@
# Contributing

First off, thanks for taking the time to contribute! This guide will answer
some common questions about how this project works.

While this is a Pinterest open source project, we welcome contributions from
everyone. Regular outside contributors can become project maintainers.

## Help

If you're having trouble using this project, please start by reading the [`README.md`](README.md)
and searching for solutions in the existing open and closed issues.

## Security

If you've found a security issue in one of our open source projects,
please report it at [Bugcrowd](https://bugcrowd.com/pinterest); you may even
make some money!

## Code of Conduct

Please be sure to read and understand our [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
We work hard to ensure that our projects are welcoming and inclusive to as many
people as possible.

## Reporting Issues

If you have a bug report, please provide as much information as possible so that
we can help you out:

- Version of the project you're using.
- Code (or even better whole projects) which reproduce the issue.
- Steps which reproduce the issue.
- Stack traces for crashes.
- Any logs produced.

## Making Changes

If you reading this - then you have decided to contribute to our project. Oh, poor you...
Rules are very simple:
1. Fork this repository to your own account
2. Make your changes and verify that tests pass
2. Make your changes and verify that tests pass (or wait that our CI/CD will do everything for you)
3. Commit your work and push to a new branch on your fork
4. Submit a pull request
5. Participate in the code review process by responding to feedback

Once there is agreement that the code is in good shape, one of the project's
maintainers will merge your contribution.

To increase the chances that your pull request will be accepted:

- Follow the coding style
- Write tests for your changes
- Write a good commit message

If you would like to introduce a new rule to the core set, please [file an issue](https://github.com/pinterest/ktlint/issues/new)
first so that it can be discussed amongst the community. Remember that you are can make your own custom rulesets
without having to change the core ruleset.

New core rules will be added first to the experimental ruleset before being rolled out widely.
# Hooks

## License
We have some hooks to a commit messages:
1) your commit message should have the following format:
```
Brief Description
By contributing to this project, you agree that your contributions will be
licensed under its [license](LICENSE).
### What's done:
1) Long description
2) Long description
```
21 changes: 16 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
Copyright 2019 Pinterest, Inc.
Copyright 2016-2019 Stanley Shyiko
The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
## diKTat project
diKTat - is a rule set of Kotlin code style rules that are using [KTlint](https://ktlint.github.io/) framework.
diKTat - is a rule set of Kotlin code style rules that are using [KTlint](https://ktlint.github.io/) framework under the hood.
In this project we are trying to define Kotlin code style rules and implement them as visitors for AST tree provided by Ktlint.

Main components are:
1) diktat-ruleset - number of rules that are supported by diKTat
2) diktat-test-framework - functional/unit test framework that can be used for running your code fixer on the initial code and compare it with the expected result
3) customized fork of ktlint project - temporary added until we will publish our ideas to main repository
4) also see our demo: diktat-demo in a separate repository
3) also see our demo: diktat-demo in a separate repository

## What was hacked and changed in KTlint and why do we temporary need a fork of it?
Mainly we wanted to create a common configurable mechanism that will give us a chance to enable/disable and customize all rules.
Expand All @@ -17,14 +16,11 @@ That's why we added logic for:
## How to build the project
As Java/Kotlin community has a holywar about usage of Gradle vs Maven - we supported both. So you can:

a) Use Maven:
Use Maven:
`mvn clean install`

This will also install git hooks into your local .git directory. The hooks will restrict commit messages and branch naming.

b) Use Gradle:
`gradle build`

## What is rules-config.json and why should I care?
In ktlint rules can be configured via .editorconfig, but this does not give a chance to customize or enable/disable each and every rule independently.
That is why we have supported rules-config.json that can be easily changed and help in customization of your own rule set.
Expand Down
23 changes: 0 additions & 23 deletions RELEASING.md

This file was deleted.

File renamed without changes.
4 changes: 1 addition & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
<properties>
<java.version>1.8</java.version>
<kotlin.version>1.3.70</kotlin.version>
<ktlint.version>0.37.0-SNAPSHOT</ktlint.version>
<ktlint.version>0.37.0-fork</ktlint.version>
<guava.version>29.0-jre</guava.version>
<jackson.version>2.10.3</jackson.version>
<slf4j.version>1.7.5</slf4j.version>
<commons-cli.version>1.4</commons-cli.version>
</properties>

<modules>
<module>ktlint-core</module>
<module>ktlint-test</module>
<module>diktat-common</module>
<module>diktat-rules</module>
<module>diktat-test-framework</module>
Expand Down

0 comments on commit f10f668

Please sign in to comment.