Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White-paper #438

Merged
merged 15 commits into from
Nov 24, 2020
Merged

White-paper #438

merged 15 commits into from
Nov 24, 2020

Conversation

kentr0w
Copy link
Collaborator

@kentr0w kentr0w commented Oct 23, 2020

What's done:

Created structure and some describe

### What's done:
   Created structure and some describe
@kentr0w kentr0w added the documentation Improvements or additions to documentation label Oct 23, 2020
@kentr0w kentr0w requested review from aktsay6 and orchestr7 October 23, 2020 09:56
@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #438 (30405ee) into master (052bd9d) will increase coverage by 0.17%.
The diff coverage is 92.42%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #438      +/-   ##
============================================
+ Coverage     81.68%   81.86%   +0.17%     
- Complexity     1641     1696      +55     
============================================
  Files            79       85       +6     
  Lines          4139     4257     +118     
  Branches       1307     1325      +18     
============================================
+ Hits           3381     3485     +104     
- Misses          229      237       +8     
- Partials        529      535       +6     
Flag Coverage Δ Complexity Δ
unittests 81.86% <92.42%> (+0.17%) 0.00 <38.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...at-rules/src/main/kotlin/generated/WarningNames.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...lin/org/cqfn/diktat/ruleset/rules/PackageNaming.kt 93.75% <33.33%> (-1.19%) 32.00 <0.00> (ø)
...ktat/ruleset/rules/AvoidEmptyPrimaryConstructor.kt 90.00% <90.00%> (ø) 8.00 <8.00> (?)
...iktat/ruleset/rules/ImplicitBackingPropertyRule.kt 93.75% <93.75%> (ø) 23.00 <23.00> (?)
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 98.34% <100.00%> (+0.02%) 10.00 <0.00> (ø)
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 97.33% <100.00%> (+0.07%) 8.00 <0.00> (ø)
...qfn/diktat/ruleset/rules/classes/SingleInitRule.kt 78.46% <100.00%> (+0.68%) 16.00 <0.00> (+6.00)
.../cqfn/diktat/ruleset/rules/files/BlankLinesRule.kt 100.00% <100.00%> (ø) 13.00 <7.00> (+1.00)
...rg/cqfn/diktat/ruleset/rules/files/NewlinesRule.kt 83.95% <100.00%> (+0.17%) 110.00 <0.00> (+6.00)
...g/cqfn/diktat/ruleset/rules/kdoc/KdocFormatting.kt 77.12% <100.00%> (-0.15%) 73.00 <0.00> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ab49e1...30405ee. Read the comment docs.

wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/compare.tex Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
Before continue, it is necessary to define some terms so that the reader correctly understands the context of what was written. The first and basic concept that should be introduced is \textbf{"rule"}. In diKTat, a “rule” is a class where it is checked if the source code of a certain part of the code style. \textbf{Ruleset}, in turn, is a set of such "rules". Node - ...? ASTNode -? syntax tree - ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, also add references
you can add a little bit math with "множества". You can describe множество (set of rules), set of inspections.

wp/sections/diKTat.tex Outdated Show resolved Hide resolved
wp/sections/diKTat.tex Outdated Show resolved Hide resolved
wp/sections/download.tex Outdated Show resolved Hide resolved
wp/sections/download.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/work.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/work.tex Outdated Show resolved Hide resolved
@petertrr petertrr linked an issue Oct 27, 2020 that may be closed by this pull request
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/work.tex Outdated Show resolved Hide resolved
@orchestr7
Copy link
Member

we need references and literature

@orchestr7
Copy link
Member

we need pseudo-math :)
like rule - is a set of blabla
inspection - is a unification of two rules: checkers and fixer

wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/compare.tex Outdated Show resolved Hide resolved

\subsection{About diKTat}
\par Diktat as well as ktlint and detekt is a static code analysis tool. It's development started in 2020 and at the time of writing this whitepaper diKTat has 130 stars and 12 forks. DiKTat operates on AST provided by IntelliJ.
\par So why is diKTat better? First of all, we support much more rules than ktlint. Our ruleset includes more than 100 rules. Second, diKTat is configurable. A lot of rules have it's own settings, which can be easily understood. For example, you can choose whether you need a copyright or choose a length of line. Third, diKTat is very easy to configure. You don't need to spend hours only to understand what each rule is doing. Our ruleset is a yml file, where each rule is commented out. Last but not the least, diKTat can be used as a CI/CD tool in order to avoid merging errors in the code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many rules does ktlint have? We should specify it too if we are using our figure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number of rules are specified in the table. Should we mention their number in each subsection?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I didn't see the table, where is it? I just thought that if we say that we have 100 rules which is more than ktlint has, we should say exactly how many does ktlint have.

wp/sections/compare.tex Outdated Show resolved Hide resolved
wp/sections/definition.tex Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
Before continue, it is necessary to define some terms so that the reader correctly understands the context of what was written. The first and basic concept that should be introduced is \textbf{"rule"}. In diKTat, a “rule” is a class where it is checked if the source code of a certain part of the code style. \textbf{Ruleset}, in turn, is a set of such "rules". \textbf{Abstract syntax tree(AST)} is a tree representation of the abstract syntactic structure of source code written in a programming language. Each node of the tree denotes a construct occurring in the source code. Node \footnote{\url{ https://www.ibm.com/support/knowledgecenter/SSZHNR_2.0.0/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/dom/ASTNode.html}} - is a a node of AST. \textbf{CICD} - continuous integration (CI) and continuous delivery (CD) is a methodology that allows application development teams to make changes to code more frequently and reliably. \textbf{KDoc} - is the language used to document Kotlin code (the equivalent of Java's JavaDoc).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in diktat we have not only Rules, but also Warnings which we often tend to call 'rules' or 'inspections' so that definitely needs some clarification.

wp/sections/diKTat.tex Show resolved Hide resolved
wp/sections/download.tex Outdated Show resolved Hide resolved
wp/sections/download.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/feature.tex Show resolved Hide resolved
wp/sections/feature.tex Outdated Show resolved Hide resolved
wp/sections/introduction.tex Outdated Show resolved Hide resolved
wp/sections/kotlin.tex Outdated Show resolved Hide resolved
wp/sections/kotlin.tex Outdated Show resolved Hide resolved
wp/sections/kotlin.tex Outdated Show resolved Hide resolved
wp/sections/kotlin.tex Outdated Show resolved Hide resolved
wp/sections/kotlin.tex Outdated Show resolved Hide resolved
wp/sections/kotlin.tex Outdated Show resolved Hide resolved
wp/sections/work.tex Outdated Show resolved Hide resolved
wp/sections/work.tex Outdated Show resolved Hide resolved
wp/sections/work.tex Outdated Show resolved Hide resolved
wp/sections/work.tex Outdated Show resolved Hide resolved
aktsay6 and others added 5 commits November 5, 2020 18:22
### What's done:
  * Fixed bugs
### What's done:
  Fixed bugs after review
### What's done:
  * Added text to diKTat section
### What's done:
    Added references and conclusion
### What's done:
   Added math
@orchestr7
Copy link
Member

### What's done:
   Fixed after review
### What's done:
    Final changes
Copy link
Member

@orchestr7 orchestr7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kentr0w kentr0w merged commit d622fdc into master Nov 24, 2020
@kentr0w kentr0w deleted the feature/white-paper branch November 24, 2020 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Whitepaper: create intro for diktat
4 participants